"Bella," I corrected him, with a smile. Bella我用笑容回应他。 "I'm Mike.""Hi, Mike.""Do you need any help finding your next class?""I'm headed to the gym, act ...
分类:
其他好文 时间:
2016-10-06 19:57:50
阅读次数:
176
01背包变形,注意dp过程的时候就需要取膜,否则会出错。 代码如下: ...
分类:
其他好文 时间:
2016-10-06 19:55:07
阅读次数:
180
题目链接 http://codeforces.com/gym/101102/problem/J Description standard input/output You are given an array A of integers of size N, and Q queries. For e ...
分类:
其他好文 时间:
2016-10-06 12:52:43
阅读次数:
149
题目链接 http://codeforces.com/gym/100917/problem/J Description standard input/outputStatements The jury of Berland regional olympiad in informatics does ...
分类:
其他好文 时间:
2016-10-04 12:02:41
阅读次数:
154
题目链接 题目大意:给定一个长度为n的字符串,字符串仅由"F","N","A"三种字符组成,现有一种操作P,即把两个相邻的字符调换位置。要求把所有的A都放在所有的F左侧,问需要的最少操作P的次数。 思路:首先从左至右的扫描原串,对于每一个"A",设它的左侧有x个"F",则必然至少需要x次操作将"A" ...
分类:
其他好文 时间:
2016-10-02 21:45:54
阅读次数:
96
题目: Description standard input/outputStatements Little Liesbeth likes to play with strings. Initially she got a string of length n, consisting of lett ...
分类:
其他好文 时间:
2016-10-02 21:42:53
阅读次数:
136
Sn=a1*(1-q^n)/(1-q),枚举q的值,判断a1是否为整数,比较暴力 ...
分类:
其他好文 时间:
2016-10-02 15:15:46
阅读次数:
170
题目链接 http://codeforces.com/gym/100917/problem/D problem description Famous Berland coder and IT manager Linus Gates announced his next proprietary ope ...
分类:
其他好文 时间:
2016-10-01 19:48:53
阅读次数:
234
题意:一个团队要去参观一些学校,某些学校要在某些学校之前先参观,并且每个学校有一个权值,团队去的时间与权值的差作为难过度(最小是0), 所有的难过度的最大值是伤心度,让你安排参观顺序,使得这个伤心度最小。 析:拓扑排序,并且要逆序排,这样的话,时间大的优先,可以用优先队列实现。 代码如下: ...
分类:
编程语言 时间:
2016-10-01 15:03:05
阅读次数:
212
题目链接 http://codeforces.com/gym/101102/problem/D problem description Given an R×C grid with each cell containing an integer, find the number of subrect ...
分类:
其他好文 时间:
2016-10-01 00:14:58
阅读次数:
191