题目传送门 /* 题意:一个汉堡制作由字符串得出,自己有一些原材料,还有钱可以去商店购买原材料,问最多能做几个汉堡 二分:二分汉堡个数,判断此时所花费的钱是否在规定以内 */ #include <cstdio> #include <algorithm> #include <cmath> using namespace std; typedef long long ll; ; const int INF = 0x3f3f3f3f; char ham[MAXN]; ll n…
C. Hamburgers time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Polycarpus loves hamburgers very much. He especially adores the hamburgers he makes with his own hands. Polycarpus thinks that…
500pt, 题目链接:http://codeforces.com/problemset/problem/371/A 分析:k-periodic说明每一段长度为k,整个数组被分成这样长度为k的片段,要使得修改最少,求出k长度的片段中每个位置出现次数最多的数就行. 代码: #include <vector> #include <list> #include <map> #include <set> #include <deque> #include…
C. Hamburgers time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Polycarpus loves hamburgers very much. He especially adores the hamburgers he makes with his own hands. Polycarpus thinks that…
D. Vessels time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output There is a system of n vessels arranged one above the other as shown in the figure below. Assume that the vessels are numbered fr…
B. Fox Dividing Cheese time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Two little greedy bears have found two pieces of cheese in the forest of weight a and b grams, correspondingly. The be…
A,B大水题,不过B题逗比了题意没理解清楚,讲的太不清楚了感觉= =还是英语弱,白白错了两发. C: 二分答案判断是否可行,也逗比了下...二分的上界开太大导致爆long long了...   D: 看完题想都不想就用线段树搞起了,虽然我知道并查集很简单..不过没用并查集写过区间处理的问题就不用多想了.. 刚开始时,所有的船都是空的,也就是说可放的水量是船的容量,然后对于第一个操作,意思就是从第x个数开始减小直到减小了p或者后面都变成0了.这里我就二分查找下最右边的会减小的数R,然后把x~R-1…
Codeforces Round #366 (Div. 2) A I hate that I love that I hate it水题 #I hate that I love that I hate it n = int(raw_input()) s = "" a = ["I hate that ","I love that ", "I hate it","I love it"] for i in ran…
Codeforces Round #354 (Div. 2) Problems     # Name     A Nicholas and Permutation standard input/output 1 s, 256 MB    x3384 B Pyramid of Glasses standard input/output 1 s, 256 MB    x1462 C Vasya and String standard input/output 1 s, 256 MB    x1393…
直达–>Codeforces Round #368 (Div. 2) A Brain’s Photos 给你一个NxM的矩阵,一个字母代表一种颜色,如果有”C”,”M”,”Y”三种中任意一种就输出”#Color”,如果只有”G”,”B”,”W”就输出”#Black&White”. #include <cstdio> #include <cstring> using namespace std; const int maxn = 200; const int INF =…