http://codeforces.com/contest/339/ 这场正是水题大放送,在家晚上限制,赛后做了虚拟比赛 A,B 乱搞水题 C 我是贪心过的,枚举一下第一个拿的,然后选使差值最小的那个物品. code D 裸的线段树,几乎不用思考,push_up函数要注意一下即可 code E 最多三层,暴力搜一下.按以下两个方向搜索 1.找到左边第一个不匹配点l,从右往左找到标号为l的位置r,翻转区间<l, r> 2.找到右边第一个不匹配点r,从右往左找到标号为l的位置l,翻转区间<l…
D. Xenia and Bit Operations time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Xenia the beginner programmer has a sequence a, consisting of 2n non-negative integers: a1, a2, ..., a2n. Xenia…
这题也是一个线段树的水题: 不过开始题目没看明白,害得我敲了一个好复杂的程序.蛋疼啊.... 最后十几分钟的时候突然领悟到了题意,但是还是漏掉一个细节,老是过不去... 以后比赛的时候不喝啤酒了,再也不喝了.... 贴上代码: #include<cstdio> #include<cstring> #define maxn 262200 using namespace std; struct tree { int num; int l,r; tree *left,*right; }…
A. Helpful Maths time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Xenia the beginner mathematician is a third year student at elementary school. She is now learning the addition operation.…
D. Polyline 题目连接: http://www.codeforces.com/contest/617/problem/D Descriptionww.co There are three points marked on the coordinate plane. The goal is to make a simple polyline, without self-intersections and self-touches, such that it passes through…
B. Archer Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/312/problem/B Description SmallR is an archer. SmallR is taking a match of archer with Zanoes. They try to shoot in the target in turns, and SmallR shoots first. The…
C. Cinema 题目连接: http://www.codeforces.com/contest/670/problem/C Description Moscow is hosting a major international conference, which is attended by n scientists from different countries. Each of the scientists knows exactly one language. For conveni…
A. Holidays 题目连接: http://www.codeforces.com/contest/670/problem/A Description On the planet Mars a year lasts exactly n days (there are no leap years on Mars). But Martians have the same weeks as earthlings - 5 work days and then 2 days off. Your tas…
B. Chips Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/333/problem/B Description Gerald plays the following game. He has a checkered field of size n × n cells, where m various cells are banned. Before the game, he has to…
C. Necklace 题目连接: http://www.codeforces.com/contest/613/problem/C Description Ivan wants to make a necklace as a present to his beloved girl. A necklace is a cyclic sequence of beads of different colors. Ivan says that necklace is beautiful relative…
CF链接 http://codeforces.com/contest/1011/problem/A Natasha is going to fly to Mars. She needs to build a rocket, which consists of several stages in some order. Each of the stages is defined by a lowercase Latin letter. This way, the rocket can be de…
http://codeforces.com/contest/426/problem/B B. Sereja and Mirroring time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Let's assume that we are given a matrix b of size x × y, let's determine…
B. Chocolate 题目连接: http://www.codeforces.com/contest/617/problem/D Descriptionww.co Bob loves everything sweet. His favorite chocolate bar consists of pieces, each piece may contain a nut. Bob wants to break the bar of chocolate into multiple pieces…
A. Elephant 题目连接: http://www.codeforces.com/contest/617/problem/A Descriptionww.co An elephant decided to visit his friend. It turned out that the elephant's house is located at point 0 and his friend's house is located at point x(x > 0) of the coord…
A. Bulbs 题目连接: http://www.codeforces.com/contest/615/problem/A Description Vasya wants to turn on Christmas lights consisting of m bulbs. Initially, all bulbs are turned off. There are n buttons, each of them is connected to some set of bulbs. Vasya…
A. Treasure Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/494/problem/A Description Malek has recently found a treasure map. While he was looking for a treasure he found a locked door. There was a string s written on the…
B. Rebranding Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/591/problem/B Description The name of one small but proud corporation consists of n lowercase English letters. The Corporation has decided to try rebranding — an…
后天考试,今天做题,我真佩服自己... 这次又只A俩水题... orz各路神犇... 话说这次模拟题挺多... 半个多小时把前面俩水题做完,然后卡C,和往常一样,题目看懂做不出来... A: 算是模拟吧,反正看懂题目后很可耻的生硬水果,没被hack我觉得非常开心... 由于要求两个人至少一个没跳过,画图后发现很偷懒的方法. 虽然跟样例不同,但过了... #include <cstdio> int main() { int n, m; scanf("%d%d", &n…