fedor game and new

Go - Making Arrays and Slices Safe for Concurrent Use

Problem: You want to make arrays and slices safe for concurrent use by multiple goroutines. Solution: Use a mutex from the sync library to safeguard t ......
Concurrent Arrays Making Slices Safe

MongoDB and Mongoose in Action All In One

MongoDB and Mongoose in Action All In One Node.js API Server ......
Mongoose MongoDB Action All and

Travelling Salesman and Special Numbers

prologue 模拟赛的一道题,结果没做出来,丢大人,败大兴。所以过来糊一篇题解。 analysis 我们看到数据范围这么大,那么肯定不可以一个一个遍历(废话),所以就要考虑这个题目的性质。 我们先假设,极端数据 \(2 ^ {1000} - 1\),这个数字中包含了 \(999\) 个 1(正好 ......
Travelling Salesman Numbers Special and

CF1857F Sum and Product

根据题意我们有:\(b=a_i+a_j\),\(c=a_i\times a_j\)。 可以发现 \(a_i\) 和 \(a_j\) 是一元二次方程 \(x^2-bx+c=0\) 的根。 那么就可以根据求根公式 \(x=\dfrac{-b\pm \sqrt{b^2-4ac}}{2a}\) 来求出 \( ......
Product 1857F 1857 Sum and

Codeforces Round 901 (Div. 2) D. Jellyfish and Mex (DP)

Codeforces Round 901 (Div. 2) D. Jellyfish and Mex //思路:对于大于mex的数不做处理,把0删完为结束 //dp[j]为mex更新到j所需要的最小花费 //用mex=i时更新到j,转移方程为 dp[j] = min(dp[j], dp[i] + i ......
Codeforces Jellyfish Round 901 Div

Codeforces Round 901 (Div. 2) C. Jellyfish and Green Apple (位运算)

Codeforces Round 901 (Div. 2) C. Jellyfish and Green Apple //思路:浮点数转二进制,a/b的结果为 gcd(a,b)*最简分式(n/m)的结果 //苹果能分的前提是人数得是一个2的次幂数,通过切割只能分为形同0.001的二进制小数 //a/ ......
Codeforces Jellyfish Apple Round Green

「CF1491H」Yuezheng Ling and Dynamic Tree

\(\text{「CF1491H」Yuezheng Ling and Dynamic Tree}\) \(\text{Solution}\) 根据弹飞绵羊的思路,考虑分块维护一个 \(\text{top}(u)\) 表示 \(u\) 第一个不在当前块的祖先,设块长为 \(O(B)\),考虑如何求 \ ......
Yuezheng Dynamic 1491H 1491 Ling

difference between a Client-Server and Sender-Receiver interface in Autosar

the difference between a Client-Server and Sender-Receiver interface in Autosar In a Client-Server interface, the client requests a service from the s ......

EF Core – 8.0 new features

参考 Docs – What's New in EF Core 8 Support DateOnly and TimeOnly ......
features Core 8.0 new EF

xpath 处理自增的id manage11 使用表达式 //*[starts-with(@id, "manage") and number(substring-after(@id, "manage")) = 11]

//*[starts-with(@id, "manage") and number(substring-after(@id, "manage")) = 11] 1.使用starts-with()函数选择以"manage"开头的所有元素, 2.使用substring-after()函数获取ID中"ma ......

G. Vlad and the Mountains

G. Vlad and the Mountains 题意:给你每个点的高度,从a到b需要消耗h[b]-h[a]的体力值(所以说下坡时体力值可以增加),询问一开始你有e的体力值,问是否可以从u->v点 分析: 1.a->b最终消耗的体力值一定为h[b]-h[a],如果一开始的体力值都达不到肯定无法过 ......
Mountains Vlad and the

‘Proof of the pudding’: Global variables and PAGE_EXECUTE_WRITECOPY

‘Proof of the pudding’: Global variables and PAGE_EXECUTE_WRITECOPY UNCATEGORIZED PRODUCTION DEBUGGING, WINDBG LEAVE A COMMENT Today I was teaching a ......

Express.js read and write image file All In One

Express.js read and write image file All In One Node.js res.sendFile res.sendFile(path [, options] [, fn]) res.sendFile() is supported by Express v4.8 ......
Express image write file read

F. Lisa and the Martians

F. Lisa and the Martians 问题求y =(a[i] ^ x)& (a[j] ^ x)最大,可知x可自由选择,那么我们就考虑y怎么取最大值 1.根据&,可知a[i]a[j]1时,二进制该位置为1,若x可使得俩位置为1,那么就转换成最多的a[i]==a[j]的位置,也就是a[i]^ ......
Martians Lisa and the

《CF1824E LuoTianyi and Cartridge》 解题报告

好题。 模拟赛出了这题,抽象。 初步化简: 由于 \(\min (A,C)\) 不好处理,我们考虑从大到小加边加点,或者从小到大删边删点。 一般题目是考虑加边加点好操作一点,这题是考虑删边删点好操作。 然后我们记当前枚举的 \(\min (A,C)\) 的最小值是多少,记为 \(x\) 。然后称大于 ......
LuoTianyi Cartridge 报告 1824E 1824

[题解] CF1245D - Shichikuji and Power Grid

CF1245D - Shichikuji and Power Grid 题目传送门 题意 在一个网格图中,有 \(n\) 个城市。目标是使得 \(n\) 个城市都通电。 对于一个城市有电,要么选择在其位置建立发电站,要么和另一个有电的城市连线。 对于城市 \(i\) ,在其位置建立发电站的费用为 \ ......
题解 Shichikuji 1245D Power 1245

E. Nastya and Potions

E. Nastya and Potions 思路:直接对比制造这份药剂和直接买那个更好 判断特殊: 1.如果已经拥有就不用再买了 2.如果只能买,就直接买 方法: 1.dfs,因为要制造3,可能先要制造1,这样我们就dfs把条件从叶子节点全都往上传就行 优化: 1.如果之前已经知道了制造的价格,那么 ......
Potions Nastya and

[ARC155D] Avoid Coprime Game

[ARC155D] Avoid Coprime Game 一个暴力思路是直接记录选了哪些 \(a\) 然后转移,但是我们显然没办法将已选择的 \(a\) 的信息用状压全部记录下来。但是你注意到题目中对 \(a\) 的选择有着不错的性质,具体如下: 若确定当前 \(G\),则先前选择的所有 \(a_i ......
Coprime Avoid 155D Game ARC

【bitset】【线段树】CF633G Yash And Trees 题解

CF633G 简单题。 先看到子树加和子树质数个数和,果断转换为 dfs 序进行处理。 既然有区间求和,考虑线段树。 若对于每一个节点维护一个 \(cnt\) 数组,用二进制数 \(x\) 来表示,即当 \(cnt_i = 1\) 时第 \(i\) 位为 \(1\)。设当前节点为 \(u\),左右子 ......
线段 题解 bitset Trees 633G

【组合计数】ARC058D Iroha and a Grid 题解

ARC058D 简单组合计数。 可以先把矩形旋转一下,变为求从 \((1,1)\) 走到 \((n,m)\),只能向上或向右移动。且不经过左上角的 \(A\times B\) 的禁区的方案数,对 \(10^9 + 7\) 取模。 假如没有 \(A\times B\) 的禁区的话,那么方案数为 \(C ......
题解 Iroha 058D Grid ARC

[ARC154E] Reverse and Inversion

2023-09-09 题目 [ARC154E] Reverse and Inversion 难度&重要性(1~10):9.5 题目来源 luogu 题目算法 数学 解题思路 Update :2023.8.28修改一处笔误 这是一道很妙的计数题,考试的时候没想到。 这道题我们首先会想到去化简一下式子 ......
Inversion Reverse 154E ARC 154

Lecture 2: Data Sampling and Probability

详细地址:data100Lecture2 1. 引 1.1 图表的使用 两张图片基于相同数据生成,但是表达的意思、想突出的重点完全不一样 1.2 数据科学生命周期 上图是数据科学生命周期,这节课就将如何收集数据 2. 人口普查和调查 可能会有许多误差,有的人无家可归等等,需要理解数据 3. 取样:定 ......
Probability Sampling Lecture Data and

Proj CDeepFuzz Paper Reading: NYX: Greybox Hypervisor Fuzzing using Fast Snapshots and Affine Types

Abstract 背景:hypervisor(virtual machine monitor, VMM) 保障了不同虚拟机之间的安全隔离(security boundaries) 用户:攻击场景:在云服务上运行自身的VM instances, 提升权限 本文:Nyx 目的:coverage guid ......

[CF1874D] Jellyfish and Miku

Jellyfish and Miku D<C<B,哈哈。 设 \(dp_i\) 为起点为 i 时的期望步数,则 \[dp_0=1+dp_1\\ dp_n=0\\ dp_i=1+\frac{a_{i-1}}{a_{i-1}+a_i}dp_{i-1}+\frac{a_{i-1}}{a_{i-1}+a_i ......
Jellyfish 1874D 1874 Miku and

[CF1854E] Game Bundles

题目描述 Rishi is developing games in the 2D metaverse and wants to offer game bundles to his customers. Each game has an associated enjoyment value. A ga ......
Bundles 1854E 1854 Game CF

Madoka and The Best University (cf E)( 枚举一个其中一个元素,欧拉函数,gcd)

#include<iostream> #include<cstring> using namespace std; const int Maxn=1e7; int phi[Maxn];//记录数的约数个数(欧拉函数) bool vis[Maxn];//记录数字是否访问 int prime[Maxn] ......
University 函数 元素 Madoka Best

Madoka and The Corruption Scheme (CF D)(二叉树 整体考虑)

思路 : 题意 性质 : 要让某个人赢, 从上往下 右走了几次到他, 因此 就是 从 n轮中 选择 k 次往右走的 所有情况 ans 就是 tot- C(n,i) i>k 的选择次数, 把大的数往里面赛就行了. ......
Corruption 整体 Madoka Scheme and

Commands and Queries 在 Angular 应用开发中的使用场合

Commands and Queries 模式:优化前端状态管理的新范式 在现代前端开发中,管理应用程序的状态是一项至关重要的任务。在大多数应用程序中,前端状态来自于后端系统的数据,同时还需要执行各种与后端相关的操作。传统的状态管理方法如Redux虽然强大,但对于处理来自API的状态数据需要大量的样 ......
应用开发 Commands 场合 Angular Queries

Codeforces 449E - Jzzhu and Squares

显然任意一个顶点是关键点的正方形都可以用两个量来刻画:以其任意一条边对应的直角边平行于坐标轴的直角三角形的两直角边的长度 \(i,j\)(在下文中记这样的正方形为正方形 \((i,j)\))。对于 \(i+j\) 相同的两种正方形,显然一个 \(n\times m\) 的点阵中这样的两正方形个数是相 ......
Codeforces Squares Jzzhu 449E 449

Codeforces 1874F - Jellyfish and OEIS

考虑对 \(\sum m_i-i+1\) 个不可行的集合进行容斥,即钦定一些区间集,要求它们对应的 \(p_l,p_{l+1},\cdots,p_r\) 必须是 \([l,r]\) 的排列,计算方案数乘以容斥系数之和。 如果容斥的集合中存在相交的区间,那么这个方案数其实不太好计算。不过根据区间的性质 ......
Codeforces Jellyfish 1874F 1874 OEIS