随笔分类 -  二分三分

摘要:两次二分,第一次取得最小值,第二次往右二分看是否能到更右边注意超出部分land部分要去掉#include #include using namespace std;typedef long long ll;struct edge{ int x, y, w, h;}a[10010];bool c... 阅读全文
posted @ 2015-11-16 21:13 Painting、时光 阅读(161) 评论(0) 推荐(0)
摘要:/*贪心WA一发。。二分枚举加的数赛后发现直接暴力枚举1到1000也是可以的*//************************************************* Author :Powatr* Created Time :2015-8-30 0:58:45* Fi... 阅读全文
posted @ 2015-08-30 15:04 Painting、时光 阅读(161) 评论(0) 推荐(0)
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4325/*upper_bound 找大于a[i]的最近的下标lower_bound 找大于等于a[i]的最近的下标1 2 4 4 4 5 6 ...l r l r l l l ...此时q = 4upper_bou... 阅读全文
posted @ 2015-08-25 15:13 Painting、时光 阅读(158) 评论(0) 推荐(0)
摘要:You have two friends. You want to present each of them several positive integers. You want to presentcnt1numbers to the first friend andcnt2numbers to... 阅读全文
posted @ 2015-08-02 15:01 Painting、时光 阅读(275) 评论(0) 推荐(0)
摘要:Luke wants to upgrade his home computer network from 10mbs to 100mbs. His existing network uses 10base2 (coaxial) cables that allow you to connect any... 阅读全文
posted @ 2015-08-01 15:35 Painting、时光 阅读(234) 评论(0) 推荐(0)
摘要:There are N point on X-axis . Miaomiao would like to cover them ALL by using segments with same length.There are 2 limits:1.A point is convered if the... 阅读全文
posted @ 2015-08-01 15:34 Painting、时光 阅读(156) 评论(0) 推荐(0)
摘要:Josephina is a clever girl and addicted to Machine Learning recently. Shepays much attention to a method called Linear Discriminant Analysis, whichhas... 阅读全文
posted @ 2015-08-01 15:23 Painting、时光 阅读(203) 评论(0) 推荐(0)
摘要:Farmer John has built a new long barn, with N (2 #include #include using namespace std;const int inf = 0x3f3f3f3f;const int MAX = 1e6 + 10;int n, m;in... 阅读全文
posted @ 2015-08-01 15:20 Painting、时光 阅读(179) 评论(0) 推荐(0)
摘要:Language:Cable masterTime Limit:1000MSMemory Limit:10000KTotal Submissions:29971Accepted:6349DescriptionInhabitants of the Wonderland have decided to ... 阅读全文
posted @ 2015-08-01 15:16 Painting、时光 阅读(102) 评论(0) 推荐(0)
摘要:Give you three sequences of numbers A, B, C, then we give you a number X. Now you need to calculate if you can find the three numbers Ai, Bj, Ck, whic... 阅读全文
posted @ 2015-08-01 15:15 Painting、时光 阅读(139) 评论(0) 推荐(0)
摘要:Every year the cows hold an event featuring a peculiar version of hopscotch that involves carefully jumping from rock to rock in a river. The exciteme... 阅读全文
posted @ 2015-08-01 15:13 Painting、时光 阅读(130) 评论(0) 推荐(0)
摘要:The WHU ACM Team has a big cup, with which every member drinks water. Now, we know the volume of the water in the cup, can you tell us it height?The r... 阅读全文
posted @ 2015-08-01 15:12 Painting、时光 阅读(204) 评论(0) 推荐(0)
摘要:Polycarpus loves hamburgers very much. He especially adores the hamburgers he makes with his own hands. Polycarpus thinks that there are only three de... 阅读全文
posted @ 2015-07-25 16:05 Painting、时光 阅读(205) 评论(0) 推荐(0)
摘要:Farmer John is an astounding accounting wizard and has realized he might run out of money to run the farm. He has already calculated and recorded the ... 阅读全文
posted @ 2015-07-25 16:02 Painting、时光 阅读(148) 评论(0) 推荐(0)
摘要:Little beaver is a beginner programmer, so informatics is his favorite subject. Soon his informatics teacher is going to have a birthday and the beave... 阅读全文
posted @ 2015-07-25 14:34 Painting、时光 阅读(270) 评论(0) 推荐(0)
摘要:roblem DescriptionTom owns a company and he is the boss. There are n staffs which are numbered from 1 to n in this company, and every staff has a abil... 阅读全文
posted @ 2015-07-22 15:50 Painting、时光 阅读(153) 评论(0) 推荐(0)
摘要:Given an array of positive integers and m queries.Each query contains i, j, x, output the number of occurrences of x into the subarray Ai,Ai+1...,Aj.I... 阅读全文
posted @ 2015-07-18 12:53 Painting、时光 阅读(130) 评论(0) 推荐(0)
摘要:Side onePoll flew above the City. Bright street lights flashed by below. He was winding his way around needle-sharp spires of communication towers and... 阅读全文
posted @ 2015-07-17 21:16 Painting、时光 阅读(341) 评论(0) 推荐(0)
摘要:Problem Description给定序列A={A1,A2,...,An}, 要求改变序列A中的某些元素,形成一个严格单调的序列B(严格单调的定义为:Bi= temp a[i]即使小到最小仍旧比后面一个数大,说明不可行3.其他情况为了保证严格递增 temp--二分左闭右开#include#inc... 阅读全文
posted @ 2015-06-02 21:30 Painting、时光 阅读(302) 评论(0) 推荐(0)