题目链接:http://www.lydsy.com/JudgeOnline/problem.php?id=3016 题意: 给你一个括号序列,问你至少修改多少个括号,才能使这个括号序列合法。 题解: 贪心。 cnt表示当前已经攒了多少个左括号。 从左往右枚举每一个括号: (1)如果为左括号,则cnt ...
分类:
其他好文 时间:
2017-10-06 18:10:24
阅读次数:
180
题目描述 Although Farmer John has no problems walking around the fair to collect prizes or see the shows, his cows are not in such good shape; a full day ...
分类:
其他好文 时间:
2017-10-06 12:59:47
阅读次数:
152
拼不出的数lost.in/.out/.cpp【问题描述】3 个元素的集合{5, 1,2} 的所有子集的和分别是0,1, 2, 3, 5, 6, 7, 8。发现最小的不能由该集合子集拼出的数字是4。现在给你一个n 个元素的集合,问你最小的不能由该集合子集拼出的数字是多少。注意32 位数字表示范围。 【 ...
分类:
其他好文 时间:
2017-10-06 12:59:04
阅读次数:
339
题目链接:http://poj.org/problem?id=3186 Treats for the Cows Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 6548 Accepted: 3446 Description FJ ...
分类:
其他好文 时间:
2017-10-06 12:30:32
阅读次数:
197
POJ 3621 - Sightseeing Cows 找到一个圈,要求这个圈的点权和/边权和在所有的圈中最大,输出这个比率 设最大比率为ans ,∑V/∑E为一般的圈的比率k 最大的圈的k,即ans,>=所有的圈的k 即ans>=∑V/∑E 变形:∑(ans*E-V) > 0 图中边权改为ans* ...
分类:
其他好文 时间:
2017-10-03 17:48:52
阅读次数:
200
题目OJ链接:http://bailian.openjudge.cn/practice/2456/ 题目分析: (参考http://blog.csdn.net/wuxiushu/article/details/49158843) 题意要表达的是:把C头牛放到N个带有编号的隔间里,使得任意两头牛所在的 ...
分类:
其他好文 时间:
2017-10-01 19:28:35
阅读次数:
223
Description The farm has many hills upon which Farmer John would like to place guards to ensure the safety of his valuable milk-cows. He wonders how m ...
分类:
其他好文 时间:
2017-09-28 22:25:31
阅读次数:
261
题目描述 Farmer John went to cut some wood and left N (2 ≤ N ≤ 100,000) cows eating the grass, as usual. When he returned, he found to his horror that the ...
分类:
其他好文 时间:
2017-09-28 12:53:06
阅读次数:
216
题目描述 Farmer John is herding his N cows (1 <= N <= 2,500) across the expanses of his farm when he finds himself blocked by a river. A single raft is av ...
分类:
其他好文 时间:
2017-09-28 10:05:32
阅读次数:
208
Lost's revenge Time Limit: 15000/5000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 4548 Accepted Submission(s): 1274 ...
分类:
其他好文 时间:
2017-09-27 20:54:46
阅读次数:
150