【CF Round 429 B. Godsend】】的更多相关文章

time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Leha somehow found an array consisting of n integers. Looking at it, he came up with a task. Two players play the game on the array. Players…
Time limit per test1 second memory limit per test 256 megabytes input standard input output standard output For a given positive integer n denote its k-rounding as the minimum positive integer x, such that x ends with k or more zeros in base 10 and i…
[Link]:http://codeforces.com/contest/841/problem/B [Description] 两个人轮流对一个数组玩游戏,第一个人可以把连续的一段为奇数的拿走,第二个可以拿走偶数的. 谁无法拿就输. 问谁能赢 [Solution] 如果和为奇数的话,则第一个人赢. 否则 如果n个数中没有奇数,则第二个人赢, 如果n个数中有一个奇数,那么第一个人取走它,剩下的数字还是奇数,这时候第二个人无论取还是不取,都只能减少偶数的和,剩下的肯定是奇数的和,那么第一个人就能一…
time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output In a building where Polycarp lives there are equal number of flats on each floor. Unfortunately, Polycarp don't remember how many flats are o…
time limit per test 2 seconds memory limit per test 512 megabytes input standard input output standard output Adieu l'ami. Koyomi is helping Oshino, an acquaintance of his, to take care of an open space around the abandoned Eikou Cram School building…
time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output — This is not playing but duty as allies of justice, Nii-chan! — Not allies but justice itself, Onii-chan! With hands joined, go everywhere a…
time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Even if the world is full of counterfeits, I still regard it as wonderful. Pile up herbs and incense, and arise again from the flames and ash…
time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Rock... Paper! After Karen have found the deterministic winning (losing?) strategy for rock-paper-scissors, her brother, Koyomi, comes up wit…
[Link]:http://codeforces.com/contest/841/problem/A [Description] [Solution] 模拟,贪心,每个朋友尽量地多给气球. [NumberOf WA] [Reviw] [Code] #include <bits/stdc++.h> using namespace std; #define lson l,m,rt<<1 #define rson m+1,r,rt<<1|1 #define LL long l…
[链接]点击打开链接 [题意] 给出一个连通图,并给每个点赋一个d值0或1或-1,要求选出一个边的集合,使得所有的点i要么d[i] == -1,要么  dgree[i] % 2 == d[i],dgree[i]代表i结点的度数. [题解] 先统计出所有点所要求的度数的和cnt1.(不考虑-1); 这里的cnt1的奇偶性也就是最后的图的所有点的度数和的奇偶性. 显然只要是一张图,它的所有的度数的和就必须为偶数. 所以,如果cnt1是个奇数,且没有为-1的点,那么直接输出-1就好,无解. 如果有-1…