
ACM - 二分
文章平均质量分 65
Freenm
这个作者很懒,什么都没留下…
展开
-
codeforces 279B - Books
二分查找。#includeint n,t,a[100000+5];bool judge(int num){ int sum=0; for(int j=1;j<=num;j++) sum+=a[j]; if(sum<=t) return true;//先把第一本书作为开始,读num本书,算出耗时 for(int i=2;i<=n-num+1;i++) { sum=sum-a[原创 2017-04-07 23:18:38 · 404 阅读 · 0 评论 -
POJ 3258 - River Hopscotch
题目大意:题目很长哈,简单来说,数轴上有n个石子,第i个石头的坐标为Di,现在要从0跳到L,每次条都从一个石子跳到相邻的下一个石子。现在FJ允许你移走M个石子,问移走这M个石子后,相邻两个石子距离的最小值的最大值是多少,因为移动有很多种方法,每一种有一个最小值距离,这些最小值里面的最大值(我之所以解释最后一句,是因为我兄弟他没懂--其实不是我翻译的,嘿嘿)。思路:在这里二分的对象当然是距离咯,原创 2017-03-16 22:27:05 · 373 阅读 · 0 评论 -
HDU 4430 - Yukari's Birthday
Time Limit: 12000/6000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5505 Accepted Submission(s): 1320Problem DescriptionToday is Yukari's n-th b原创 2017-03-14 22:58:28 · 357 阅读 · 0 评论 -
codeforces 782B - The Meeting Place Cannot Be Changed
time limit per test5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe main road in Bytecity is a straight line from south to north原创 2017-03-13 23:08:44 · 443 阅读 · 0 评论 -
codeforces 779D - String Game
time limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputLittle Nastya has a hobby, she likes to remove some letters from原创 2017-03-13 22:57:47 · 451 阅读 · 0 评论 -
POJ 2456 - Aggressive cows
DescriptionFarmer John has built a new long barn, with N (2 His C (2 <= C <= N) cows don't like this barn layout and become aggressive towards each other once put into a stall. To prevent the原创 2017-03-13 12:32:19 · 350 阅读 · 0 评论 -
POJ 3067 - Japan
抽象来说就是求逆序对的问题,虽然放在树状数组的章节里,但不一定要用树状数组,归并排序也可以……#include#include#define MAX 1000*1000+3using namespace std;struct Road{ int u,v;}road[MAX],tmp[MAX];int n,m,k;long long cnt;bool cmp(Road a,Ro原创 2017-04-25 20:34:48 · 347 阅读 · 0 评论