B. Strings of Power Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/318/problem/C Description Let us call a pair of integer numbers m-perfect, if at least one number in the pair is greater than or equal to m. Thus, the pair…
A. Even Odds 奇数个数\(\lfloor \frac{n+1}{2}\rfloor\) B. Strings of Power 从位置0开始,统计heavy个数,若当前为metal,则可以和之前的所有heavy配对. C. Perfect Pair 假设\(x\le y\),显然用\(x+y\)替换\(x\)可以达到最少步数. \(x\)会一直\(+y\)直到\(x'\gt y\). D. Ants 暴力模拟??? E. Balance 构出一棵树后,就随便做了. F. Game w…
题目传送门 B. Perfect Number time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output We consider a positive integer perfect, if and only if the sum of its digits is exactly 1010. Given a positive integ…
B. Ants Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/317/problem/B Description It has been noted that if some ants are put in the junctions of the graphene integer lattice then they will act in the following fashion: eve…
B. Strings of Power Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/318/problem/B Description Volodya likes listening to heavy metal and (occasionally) reading. No wonder Volodya is especially interested in texts concerning…
A. Even Odds Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/318/problem/A Description Being a nonconformist, Volodya is displeased with the current state of things, particularly with the order of natural numbers (natural n…
A. A Compatible Pair time limit per test1 second memory limit per test256 megabytes Problem Description Nian is a monster which lives deep in the oceans. Once a year, it shows up on the land, devouring livestock and even people. In order to keep the…
B. Perfect Number time limit per test2 seconds memory limit per test256 megabytes Problem Description We consider a positive integer perfect, if and only if the sum of its digits is exactly 10. Given a positive integer k, your task is to find the k-t…
将整个游戏可以划分成若干个互不相交的子游戏. 每个子游戏的sg值只与其中的数的个数有关.而这个数不会超过30. 于是可以预处理出这个sg值表. 然后从1到n枚举,对<=sqrt(n)的部分,用个set判重. 对于大于sqrt(n)的部分,统计其中不包含在之前已经划分出来的子游戏内的数的个数,如果是奇数,就再异或上1. /* #include<cstdio> #include<cstring> #include<set> #include<map> us…
B. Long Jumps Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/480/problem/B Description Valery is a PE teacher at a school in Berland. Soon the students are going to take a test in long jumps, and Valery has lost his favorit…