
二分法
hubayi31072
这个作者很懒,什么都没留下…
展开
-
B - Pie
点击打开链接 My birthday is coming up and traditionally I'm serving pie. Not just one pie, no, I have a number N of them, of various tastes and of various sizes. F of my friends are coming to my part原创 2017-07-27 23:39:25 · 242 阅读 · 0 评论 -
【hpu 1016 985的0-1串难题 [二分、尺取]】
点击打开链接 AC代码: #include #include char s[100010]; int table[100010]; int n,k; void Check() { memset(table,0,sizeof(table)); if(s[0]=='0') table[0]=1; for(int i=1;i<n;i++) if(s[i]=='0原创 2017-08-31 22:25:33 · 212 阅读 · 0 评论 -
【51 nod 1090 三个数和为0】
点击打开链接 给出一个长度为N的无序数组,数组中的元素为整数,有正有负包括0,并互不相等。从中找出所有和 = 0的3个数的组合。如果没有这样的组合,输出No Solution。如果有多个,按照3个数中最小的数从小到大排序,如果最小的数相等则按照第二小的数排序。 Input 第1行,1个数N,N为数组的长度(0 <= N <= 1000) 第2 - N原创 2017-10-06 10:32:42 · 264 阅读 · 0 评论