
二分法
文章平均质量分 81
J_Sure
唯苦修深思方能顿悟
展开
-
AOJ-AHU-OJ-466 Monthly Expense
Monthly ExpenseTime Limit: 2000 ms Case Time Limit: 1000 ms Memory Limit: 64 MBJudge By CaseDescriptionFarmer John is an astounding accounting wizard and has realized he might run out of原创 2014-03-18 19:44:30 · 1243 阅读 · 0 评论 -
AOJ-AHU-OJ-189 最长递增子序列(模拟+二分查找)
上次这道题目,一看就想起来DFS的方法解决了。但是时间复杂度比较大,耗时多。优化一下!并不需要每个结点都DFS滴!我们用人脑解决此问题的时候,解题过程是这样的:大脑中开辟一个数组,储存当前方案。先存好序列第一个元素,然后看第二个。将第二个元素插入到最优方案中,再看第三个,如果第三个更小,则覆盖第二个元素保存,在覆盖的同时,记忆了刚才被覆盖元素能达到的最远距离。需要再开一个数组保存每个结点能原创 2014-03-12 15:03:18 · 1039 阅读 · 0 评论 -
HDU-4907 Task schedule
Task scheduleTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Problem Description有一台机器,并且给你这台机器的工作表,工作表上有n个任务,机器在ti时间执行第i个任务,1秒即可完成1个任务。有m个询问,每个询问有一个数字q原创 2014-08-06 18:48:38 · 944 阅读 · 0 评论 -
POJ-1275 Cashier Employment
Cashier EmploymentTime Limit: 1000MS Memory Limit: 10000K DescriptionA supermarket in Tehran is open 24 hours a day every day and needs a number of cashiers to原创 2014-09-05 21:13:04 · 1226 阅读 · 0 评论 -
【最大流+最短路+二分】POJ-2112 Optimal Milking
Optimal MilkingTime Limit: 2000MS Memory Limit: 30000K Case Time Limit: 1000MSDescriptionFJ has moved his K (1 <= K <= 30) milking machines out into the c原创 2014-09-19 13:05:26 · 835 阅读 · 0 评论 -
【最大流+最短路+二分】POJ-2391 Ombrophobic Bovines
Ombrophobic BovinesTime Limit: 1000MS Memory Limit: 65536K DescriptionFJ's cows really hate getting wet so much that the mere thought of getting caught in the r原创 2014-09-20 20:14:08 · 787 阅读 · 0 评论 -
【二分答案+枚举】AOJ-215 Mountain Walking
Mountain WalkingTime Limit: 1000 ms Case Time Limit: 1000 ms Memory Limit: 64 MBJudge By CaseDescriptionFarmer John and Bessie the cow have embarked on one of those 'active' vaca原创 2014-09-29 19:24:53 · 903 阅读 · 0 评论 -
【二分答案】POJ-2109 Power of Cryptography
Power of CryptographyTime Limit: 1000MS Memory Limit: 30000K DescriptionCurrent work in cryptography involves (among other things) large prime numbers and compu原创 2014-11-12 22:29:11 · 803 阅读 · 0 评论 -
【DP|LIS】POJ-2533 Longest Ordered Subsequence(O(n^2)、O(nlogn))
Longest Ordered SubsequenceTime Limit: 2000MS Memory Limit: 65536K DescriptionA numeric sequence of ai is ordered if a1 a2 aN. Let the subsequence of the given原创 2014-05-06 19:59:27 · 1075 阅读 · 0 评论 -
ZOJ-1025(POJ-1065、HDU-1051) Wooden Sticks
Wooden SticksTime Limit: 2 Seconds Memory Limit: 65536 KBThere is a pile of n wooden sticks. The length and weight of each stick are known in advance. The sticks are to be processed by a原创 2014-06-03 21:32:56 · 1305 阅读 · 0 评论 -
HDU-OJ-1257 最少拦截系统
最少拦截系统Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 16827 Accepted Submission(s): 6673Problem Description某国为了防御敌国的导弹袭击,发展出一原创 2014-06-03 20:13:52 · 1318 阅读 · 0 评论 -
AOJ-AHU-OJ-153 Redraiment的走法
Redraiment的走法Time Limit: 1000 ms Case Time Limit: 1000 ms Memory Limit: 64 MBDescriptionRedraiment是个聪明人,总是以奇怪的思考方法思考问题,但不知道为什么,他的解答总是最最巧妙,我们隆重地称他为诡异人!有一天Jesse不经意中发现,诡异人的走路方法很特别,于是特别关原创 2014-03-15 22:05:28 · 1472 阅读 · 0 评论 -
AOJ-AHU-OJ-87 (HDU-2289)Cup
CupTime Limit: 1000 ms Case Time Limit: 1000 ms Memory Limit: 64 MBDescriptionThe WHU ACM Team has a big cup, with which every member drinks water. Now, we know the volume of the原创 2014-03-30 21:07:05 · 1141 阅读 · 0 评论 -
POJ-3122 Pie
PieTime Limit: 1000MS Memory Limit: 65536K Special JudgeDescriptionMy birthday is coming up and traditionally I'm serving pie. Not just one pie, no, I ha原创 2014-03-28 19:44:21 · 1022 阅读 · 0 评论 -
HDU-OJ-2019 K 数列有序!
数列有序!Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Problem Description有n(n Input输入数据包含多个测试实例,每组数据由两行组成,第一行是n和m,第二行是已经有序的n个数的数列。n和m同时为0标示输入数据的结束原创 2014-03-18 14:51:11 · 1372 阅读 · 0 评论 -
Round #6 C.Alice, Bob and Chocolate
题目链接:Codeforce原创 2014-04-19 18:28:40 · 1468 阅读 · 0 评论 -
HDU-OJ-2752 WiFi
WiFiTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Problem DescriptionOne day, the residents of Main Street got together and decided that they would ins原创 2014-03-27 09:51:21 · 1657 阅读 · 1 评论 -
POJ-3104 Drying
DryingTime Limit: 2000MS Memory Limit: 65536K DescriptionIt is very hard to wash and especially to dry clothes in winter. But Jane is a very smart girl. She原创 2014-03-26 19:48:56 · 1051 阅读 · 0 评论 -
POJ-3232 Accelerator
AcceleratorTime Limit: 4000MS Memory Limit: 65536K DescriptionShiming (alpc02) is a boy likes to play PopKart very much. He is a good rider in this game. And on原创 2014-03-26 20:37:01 · 1413 阅读 · 1 评论 -
POJ-2456 Aggressive cows
Aggressive cowsTime Limit: 1000MS Memory Limit: 65536KDescriptionFarmer John has built a new long barn, with N (2 His C (2 <= C <= N) cows don't like this barn layout原创 2014-03-26 19:24:32 · 1601 阅读 · 0 评论