感觉这个贪心证明挺不错的。 Problem Statement You are given \(N\) integers; the \(i\)-th of them is \(A_i\). Find the maximum possible sum of the absolute differences between...
解题报告
数列 题解【矩阵加速递推】【数学】
带关于\(n\)的高次项也可以矩阵加速。 题目描述 这是一道很简单的题。 给你两个数\(a_1,a_2\),求\(a_n\)在模\(2147439647\)下的值。 满足递推关系:\(a_n=a_{n-1}+2a_{n-2}+n^4\) 保...
AT1984 AGC001F Wide Swap 题解【拓扑排序】【线段树】【排列组合】
排列的转化以及拓扑排序的建模加线段树优化连边。 Problem Statement You are given a permutation \(P_1\dots P_N\) of the set \(\{1, 2,\dots , N\}\). You can apply the following...
CF959E Mahmoud and Ehab and the xor-MST 题解【二进制】【贪心】【生成树】
这个题真是太有意思了ovo Description Ehab is interested in the bitwise-xor operation and the special graphs. Mahmoud gave him a problem that combines both. He has a complet...
CF858F Wizard’s Tour 题解【DFS树】【贪心】【构造】
应用DFS树来构造答案的一道题。 Description All Berland residents are waiting for an unprecedented tour of wizard in his Blue Helicopter over the cities of Berland! It is wel...
CF1045I Palindrome Pairs 题解【状态压缩】【字符串】【回文串】
应该是比较好想的状压,回文算法虽然没怎么学过,但是要知道回文的性质呀。 Description After learning a lot about space exploration, a little girl named Ana wants to change the ...
Conjugate 题解【概率期望】【期望可加性】
是一道比较有水平的期望题,和AGC028B很像。 题目描述 在不存在的\(\text{noip day3}\) ⾥,小\(\text w\)见到了⼀堆堆的谜题。 比如这题为什么会叫共轭? 他并不知道答案。 有\(n\)...
CF1070C Cloud Computing 题解【扫描线】【线段树】【模拟】
这个题依然是Mayfly(tql)的idea,感觉思路也比较奇特。 Description Buber is a Berland technology company that specializes in waste of investor's money. Recently Buber decided...
CF1070A Find a Number 题解【BFS搜索】【同余】【图论】
当时打这场ACM的时候是julao队友Mayfly做出来的,要把数位转化到图上去跑。 Description You are given two positive integers \(d\) and \(s\). Find minimal positive integer \(n\) which is ...
AT3621 ARC084D Small Multiple 题解【01BFS】【同余】
把一个数学题建成一个图论题 Problem Statement Find the smallest possible sum of the digits in the decimal notation of a positive multiple of \(K\). Constrai...