A. Bear and Elections time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Limak is a grizzly bear who desires power and adoration. He wants to win in upcoming elections and rule over the Bearla…
                                                A. Bear and Elections                                                                                                                                                                            time limi…
B. String time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output One day in the IT lesson Anna and Maria learned about the lexicographic order. String x is lexicographically less than string y, i…
B.Phone Numbers 思路:就是简单的结构体排序,只是这里有一个技巧,就是结构体存储的时候,直接存各种类型的电话的数量是多少就行,在读入电话的时候,既然号码是一定的,那么就直接按照格式%c读取就好,在比较的时候也容易比较,直接比较ASCII码就行 代码: #include<iostream> #include<algorithm> #include<cstring> #include<cmath> #include<cstdio> us…
A - Chord 题意:就是环中有12个字符,给你三个字符,判断他们之间的间隔,如果第一个和第二个间隔是3并且第二个和第三个间隔是4,那么就输出minor,如果第一个和第二个间隔是4并且第二个和第三个间隔是3,那么就输出major,否则输出strange 思路:用一个数组a中相对位置存入1,因为1个循环是12,让你判断的总长度是7,所以不会产生干扰,直接进行a[i].a[i+3].a[i+7]判断即可 代码: 1 #include<iostream> 2 #include<algori…
D. Least Cost Bracket Sequence 题目连接: http://www.codeforces.com/contest/3/problem/D Description This is yet another problem on regular bracket sequences. A bracket sequence is called regular, if by inserting "+" and "1" into it we get a…
Codeforces Round #539 div2 abstract I 离散化三连 sort(pos.begin(), pos.end()); pos.erase(unique(pos.begin(), pos.end()), pos.end());if (pos.size() == 0) pos.push_back(0);int id = lower_bound (pos.begin(), pos.end(), q[i].time) - pos.begin(); II java输入输出带模…
[第3站]Codeforces Round #512 Div2 第三题莫名卡半天……一堆细节没处理,改一个发现还有一个……然后就炸了,罚了一啪啦时间 Rating又掉了……但是没什么,比上一次好多了:) +传送门+ ◇ 简单总结 前两道题非常OK,秒掉还好.心态爆炸是从第三题开始的……一开始设计的判断方法没有考虑0,然后就错了很多次,然后改了过后又没有考虑整个数要分成2个及以上的数,继续WA,最后整个程序删了重新魔改了一次终于AC.感觉最后的AC代码的复杂度要比原来高一些,但是毕竟AC了,还是不…
Codeforces Round#320 Div2 先做个标题党,骗骗访问量,结束后再来写咯. codeforces 579A Raising Bacteria codeforces 579B Finding Team Member codeforces 579C A Problem about Polyline codeforces 579D "Or" Game codeforces 579E Weakness and Poorness codeforces 579F LCS Aga…
Codeforces Round #564(div2) 本来以为是送分场,结果成了送命场. 菜是原罪 A SB题,上来读不懂题就交WA了一发,代码就不粘了 B 简单构造 很明显,\(n*n\)的矩阵可以按照这个顺序排列 然后根据\(n\)的大小搞一搞就好了 #include<cstdio> #include<cctype> #include<cstring> #include<algorithm> #include<iostream> #incl…