有一点点难的数学题。 Description You are given three positive (greater than zero) integers $c$, $d$ and $x$. You have to find the number of pairs of positive integers $(a,b)$ such tha...
Codeforces
CF102920L Two Buildings【分治】【决策单调性】
优秀的分治题目。是“2020-2021 ACM-ICPC, Asia Seoul Regional Contest”的一道题。 Description There are $n$ buildings along a horizontal street. The buildings are next to each other along the...
CF102780D Power play【数学】【二分】【快速幂】
终于有用高中/大学学到的知识能做的题了。 Description While analyzing a mathematical problem, a programmer, Basil by name, noticed an interesting fact: for the numbers $2$ and $4$ holds the ...
CF1336A Linova and Kindom 【图论】【树形DP】【贪心】
一道比较简单的树题,如果题目想复杂了可以找一些性质简化一下。 Description Writing light novels is the most important thing in Linova's life. Last night, Linova dreamed about a fantastic kin...
CF1163E Magical Permutation 题解【线性基】【递归】【构造】
首先恭喜 xht37 喜提本场 rk1。 考场上想到线性基了不会构造…貌似还有一些别的细节 Description Kuro has just learned about permutations and he is really excited to create a new permutation typ...
Codeforces Round #545 (Div. 2) 题解
题目链接 A. Sushi for Two 题意 在一个 01 序列中找出长为偶数的连续的一段使得它前一半和后一半内部分别相同,而前一半和后一半不同。 $ 2\le n\le 100\ 000$ 题解 令共有 $ k$ 段连续的区间,第 $ i$ 段...
Codeforces Round #514 (Div. 2) 题解集/随笔
这场是UTC+8的22:35~0:35场。 随笔部分 首先提一下打了这场的收获和教训吧。A题是在开场2分钟看到题面,开场7分钟切掉的,放在以前应该是B题的位置,不过这次只有五道,想必是删掉了最...
CF1030D Vasya and Triangle 题解【数学】【gcd】【解析几何】
考试的时候看出来了一个比较重要的结论就写出来了…… Description Vasya has got three integers \(n,m\) and \(k\). He'd like to find three integer points \((x1,y1),(x2,y...
【two-pointer】【队列】CF1041D Glider 题解
正常的two-pointer思想题 Description A plane is flying at a constant height of \(h\) meters above the ground surface. Let's consider that it is flying from the point \((-10...
CF471D MUH and Cube Walls 题解【KMP】【差分】【构造】
一不小心看到了一句话题解就做出来了。感觉很浪费,把思路记录一下以后看。。。 Description Polar bears Menshykov and Uslada from the zoo of St. Petersburg and elephant Horace from the...