码迷,mamicode.com
首页 >  
搜索关键字:poj 3122 pie 二分    ( 34803个结果
leetcode第一刷_Search in Rotated Sorted Array
旋转数组的查找问题。从头开始扫一遍,O(N)的复杂度,一般也能过,甚至先排序以下,再二分都能过。不过这道题的目的当然不在于此。 想一下旋转之后对我们的查找产生了什么影响。如果没旋转过,我们直接比较target与A[middle]的大小,然后总能非常确定的丢掉源数组的一半,即把搜索空间减半,但是旋转之后,只根据A[middle]是确定不了下一轮的走向的,因为即使A[middle]比target大,...
分类:其他好文   时间:2014-05-12 15:25:32    阅读次数:231
POJ 3384 半平面交
Feng Shui Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 4185   Accepted: 1279   Special Judge Description Feng shui is the ancient Chinese practice of pl...
分类:其他好文   时间:2014-05-12 15:11:08    阅读次数:380
POJ 3525 二分+半平面交
Most Distant Point from the Sea Time Limit: 5000MS   Memory Limit: 65536K Total Submissions: 3812   Accepted: 1779   Special Judge Description The main land of Japan ca...
分类:其他好文   时间:2014-05-12 14:48:41    阅读次数:438
poj 2480 欧拉函数+积性函数+GCD
题目:http://poj.org/problem?id=2480 首先要会欧拉函数:先贴欧拉函数的模板,来源于吉林大学的模板: //欧拉函数PHI(n)表示的是比n小,并且与n互质的正整数的个数(包括1)。 unsigned euler(unsignedx) {// 就是公式 unsigned i, res=x; for(i = 2; i < (int)sqrt(x ...
分类:其他好文   时间:2014-05-12 07:14:06    阅读次数:368
POJ 3273 Monthly Expense 二分答案
POJ 3273 Monthly Expense题解 又是一个二分题。题目的意思是说,在接下来的n天里,Farmer John每天需要花money[i]钱,把这些天分成k份(每份都是连续的天),要求每份的和尽量少,输出这个最小的和。 依旧是二分答案二分答案。。。但是特别奇怪,如果用一个res维护当前可行值就会WA,而且R也得用r = mid 而不是r = mid - 1。。。 这个二分真是难...
分类:其他好文   时间:2014-05-12 07:09:04    阅读次数:287
[最小表示] poj 1509 Glass Beads
题目链接: http://poj.org/problem?id=1509 Glass Beads Time Limit: 3000MS   Memory Limit: 10000K Total Submissions: 2311   Accepted: 1343 Description Once upon...
分类:其他好文   时间:2014-05-11 13:47:01    阅读次数:292
POJ 3047 Bovine Birthday 给出年月日求星期 蔡勒公式
题目来源:POJ 3047 Bovine Birthday 题意:。。。 思路:蔡勒公式 适合于1582年(中国明朝万历十年)10月15日之后的情形 公式 w = y + y/4 + c/4 - 2*c + 26 * (m+1)/10 + d - 1; m如果是1 2 月份 y要倒退1年 m += 12 y是年份的后两位 y = year%100 c是世纪 c = year/100...
分类:其他好文   时间:2014-05-11 13:28:35    阅读次数:238
POJ 3608 两凸包最近距离 旋转卡壳
Bridge Across Islands Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 8071   Accepted: 2364   Special Judge Description Thousands of thousands years ago th...
分类:其他好文   时间:2014-05-11 13:01:55    阅读次数:454
POJ 2079 凸包最大内接三角形
Triangle Time Limit: 3000MS   Memory Limit: 30000K Total Submissions: 8038   Accepted: 2375 Description Given n distinct points on a plane, your task is to find the triangl...
分类:其他好文   时间:2014-05-11 06:36:44    阅读次数:425
[有向树的最小表示] poj 1635 Subway tree systems
题目链接: http://poj.org/problem?id=1635 题目意思: 判断两棵树是否为同构的。0...
分类:其他好文   时间:2014-05-11 05:37:16    阅读次数:338
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!