A题和B题...   A. Saitama Destroys Hotel time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Saitama accidentally destroyed a hotel again. To repay the hotel company, Genos has volunteered to opera…
---恢复内容开始--- output standard output The final match of the Berland Football Cup has been held recently. The referee has shown n yellow cards throughout the match. At the beginning of the match there were a_1 players in the first team and a_2 players…
A. Joysticks time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Friends are going to play console. They have two joysticks and only one charger for them. Initially first joystick is charged at…
B. Inventory time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Companies always have a lot of equipment, furniture and other things. All of them should be tracked. To do this, there is an inv…
B. Hamming Distance Sum 题目连接: http://www.codeforces.com/contest/608/problem/A Description Genos needs your help. He was asked to solve the following programming problem by Saitama: The length of some string s is denoted |s|. The Hamming distance betw…
Codeforces Round #336 (Div. 2) D. Zuma 题意:输入一个字符串:每次消去一个回文串,问最少消去的次数为多少? 思路:一般对于可以从中间操作的,一般看成是从头开始(因为只需要考虑一边),当考虑最左边的数时,有多少中消去方法?每种消去方法对结果的贡献又是多少?同时结果的区间又是怎么变化?这就是dp式子: 1.当单独消去这个元素时,dp[l][r] = 1 + dp[l+1][r]; 2.当存在一个k,l< k <= r,使得c[l] == c[k]时,可以认为在…
Codeforces Round #609 (Div. 2)前五题题解 补题补题…… C题写挂了好几个次,最后一题看了好久题解才懂……我太迟钝了…… 然后因为longlong调了半个小时…… A.Equation 题目大意:有一个数字n,让你给出任意两个合数a,b满足a - b = n. 我们知道大于2的偶数都是合数,那么如果n为奇数,只要n加上一个奇数合数一定也为合数,如果n为偶数,那么n加上一个偶数合数也一定为合数. 因为只求任意一组,就直接选择4,9,若为奇数输出 +n 和9,偶数输出 +…
Codeforces Round #297 (Div. 2)B. Pasha and String Time Limit: 2 Sec  Memory Limit: 256 MBSubmit: xxx  Solved: 2xx 题目连接 http://codeforces.com/contest/525/problem/B Description Pasha got a very beautiful string s for his birthday, the string consists o…
B. The Time 题目连接: http://www.codeforces.com/contest/622/problem/B Description You are given the current time in 24-hour format hh:mm. Find and print the time after a minutes. Note that you should find only the time after a minutes, see the examples t…
A. Infinite Sequence 题目连接: http://www.codeforces.com/contest/622/problem/A Description Consider the infinite sequence of integers: 1, 1, 2, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 4, 5.... The sequence is built in the following way: at first the number 1 is wr…