任意门:http://codeforces.com/gym/101954/problem/E E. Locker Room time limit per test 2.0 s memory limit per test 256 MB input standard input output standard output There are several strange rooms in Binary Casino and one of them is a locker room. You ha…
H. Split Game time limit per test 1.0 s memory limit per test 256 MB input standard input output standard output For a long time, rich clientele of Binary Casino has been requesting a new way to gamble their money. To fulfill their wishes, the direct…
A - Maximum Multiple 题意:给出一个n 找x, y, z 使得$n = x + y +z$ 并且 $n \equiv 0 \pmod x, n \equiv 0 \pmod y, n \equiv 0 \pmod z$ 并且使得 $x \cdot y \cdot z$ 最大 思路:设$a = \frac{n}{x}, b = \frac{n}{y}, c = \frac{n}{z}$ 那么 $\frac{1}{a} + \frac{1}{b} + \frac{1}{c} =…
A - Absolute 留坑. B - Counting Permutations 留坑. C - Cover 留坑. D - Game puts("Yes") #include <bits/stdc++.h> using namespace std; int n; int main() { while (scanf("%d", &n) != EOF) { puts("Yes"); } ; } E - Hack It 留坑.…
A - Problem A. Ascending Rating 题意:给出n个数,给出区间长度m.对于每个区间,初始值的max为0,cnt为0.遇到一个a[i] > ans, 更新ans并且cnt++.计算 $A = \sum_{i = 1}^{i = n - m +1} (max \oplus i)$ $B = \sum_{i = 1}^{i = n - m +1} (cnt \oplus i)$ 思路:单调队列,倒着扫一遍,对于每个区间的cnt就是队列的长度,扫一遍即可. #include<…
A - Problem A. Integers Exhibition 留坑. B - Problem B. Harvest of Apples 题意:计算$\sum_{i = 0}^{i = m}C(n, i)$ 思路:由$sum_{i = 0}^{i = m}C(n,i)$可以得到$sum_{i = 0}^{i = m + 1}C(n,i)$以及$sum_{i = 0}^{i = m}C(n + 1,i)$然后用莫对算法求解 #include<bits/stdc++.h> using nam…
A - Always Online Unsolved. B - Beautiful Now Solved. 题意: 给出一个n, k 每次可以将n这个数字上的某两位交换,最多交换k次,求交换后的最大和最小值 思路: 很明显有一种思路,对于最小值,尽可能把小的放前面, 对于最大值,尽可能把打的放前面.但是如果有多个最小数字或者最大数字会无法得出放哪个好,因此BFS一下即可 #include<bits/stdc++.h> using namespace std; const int INF =…