【CodeForces 353 A】Domino】的更多相关文章

[链接] 我是链接,点我呀:) [题意] [题解] 分类讨论一波 设第一个数组的奇数个数为cnt1 第二个数组的奇数个数为cnt2 显然只有在(cnt1+cnt2)%2==0的情况下. 才可能第一个数组的和为偶数,第二个数组的和也为偶数 (因为奇数都要出现偶数次才可以. 所以只可能cnt1和cnt2都是偶数,那么输出0 否则,cnt1和cnt2都是奇数,看看有没有一个位置i只有a[i]或只有b[i]是奇数.有的话输出1. 其他情况都非法. [代码] #include <bits/stdc++.h…
转载请注明出处:http://www.cnblogs.com/Delostik/p/3553114.html 目前已有[A B C D E] 例行吐槽:趴桌子上睡着了 [A. Genetic Engineering] http://codeforces.com/contest/391/problem/A 问最少插入几个字符,使得字符串不存在连续偶数个相同字母.不说什么 #include <iostream> #include <string> using namespace std…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Polycarp has interviewed Oleg and has written the interview down without punctuation marks and spaces to save time. Thus, the interview is now a…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Galya is playing one-dimensional Sea Battle on a 1 × n grid. In this game a ships are placed on the grid. Each of the ships consists of b consecu…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Vasya is currently at a car rental service, and he wants to reach cinema. The film he has bought a ticket for starts in t minutes. There is a str…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Famous Brazil city Rio de Janeiro holds a tennis tournament and Ostap Bender doesn't want to miss this event. There will be n players participat…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Mr. Funt now lives in a country with a very specific tax laws. The total income of mr. Funt during this year is equal to n (n ≥ 2) burles and th…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Local authorities have heard a lot about combinatorial abilities of Ostap Bender so they decided to ask his help in the question of urbanization…
模拟CF650,ABC三题,RK90 Codeforces 650 A 思路:首先看式子 \(\sqrt{(x_i-x_j)^2+(y_i-y_j)^2}=|x_i-x_j|+|y_i-y_j|\) 的唯一可行的情况是\(x_i=x_j\)或\(y_i=y_j\).(因为两边之和大于第三边 所以就知道怎么做了. 第一种方法:我们维护三个\(map\),分别存行.列.坐标是\(\dots\)的时候已经有多少个节点. 然后就可以边读边算,读到\((x,y)\)这个坐标的时候把\(ans\)变成 \(…
模拟Canada Cup 2016,ABC三题,Rank1376 第三题卡住了 Codeforces 725 C 求出两个相同字符的位置,记为x和y. 然后考虑把相同的那个字符放在第一行的什么地方, 然后把x+1..y-1的部分一折两半,放在第一行的末尾再折回第二行. 再把1..x-1和y+1..n放下来就可以了. Codeforces 725 D 题意:有n个队伍,你是第一个队伍的一员,然后你可以把你们队伍拿到的一些气球给其他的队伍,如果一个队伍的气球数量大于他们的质量,那么他们就会被删除.…