随笔分类 - binary search
摘要:3231 - Fair ShareAsia - Seoul - 2004/2005You are given N processors and M jobs to be processed. Two processors are specified to each job. To processth...
阅读全文
摘要:Fence RailsBurch, Kolstad, and SchrijversFarmer John is trying to erect a fence around part of his field. He has decided on the shape of the fence and...
阅读全文
摘要:Building roadsTime Limit:2000MSMemory Limit:65536KTotal Submissions:6091Accepted:2046DescriptionFarmer John's farm has N barns, and there are some cow...
阅读全文
摘要:As you must have experienced, instead of landing immediately, an aircraft sometimes waits in a holding loop close to the runway. This holding mechanis...
阅读全文
摘要:Get Luffy OutTime Limit:2000MSMemory Limit:65536KTotal Submissions:7295Accepted:2778DescriptionRatish is a young man who always dreams of being a hero...
阅读全文
摘要:IIUPC2006Problem G: Going in Cycle!!Input: standard inputOutput: standard outputYou are given a weighted directed graph withnvertices andmedges. Each ...
阅读全文
摘要:SubsetTime Limit:30000MSMemory Limit:65536KTotal Submissions:1373Accepted:228DescriptionGiven a list of N integers with absolute values no larger than 1015, find a non empty subset of these numbers which minimizes the absolute value of the sum of its elements. In case there are multiple subsets, cho
阅读全文
摘要:SumsetsTime Limit:1000MSMemory Limit:65536KTotal Submissions:8235Accepted:2260DescriptionGiven S, a set of integers, find the largest d such that a + b + c = d where a, b, c, and d are distinct elements of S.InputSeveral S, each consisting of a line containing an integer 1 2 #include 3 #include 4...
阅读全文
摘要:4 Values whose Sum is 0Time Limit:15000MSMemory Limit:228000KTotal Submissions:14475Accepted:4138Case Time Limit:5000MSDescriptionThe SUM problem can be formulated as follows: given four lists A, B, C, D of integer values, compute how many quadruplet (a, b, c, d ) ∈ A x B x C x D are such that a + b
阅读全文
摘要:SubsequenceTime Limit:1000MSMemory Limit:65536KTotal Submissions:7854Accepted:3021DescriptionA sequence of N positive integers (10 2 #include 3 #include 4 #include 5 6 using namespace std; 7 8 #define maxn 100005 9 10 int n;11 int a[maxn],s,sum[maxn];12 13 bool check(int x) {14 for(int...
阅读全文
摘要:GarlandTime Limit:1000MSMemory Limit:10000KTotal Submissions:1236Accepted:547DescriptionThe New Year garland consists of N lamps attached to a common wire that hangs down on the ends to which outermost lamps are affixed. The wire sags under the weight of lamp in a particular way: each lamp is hangin
阅读全文
摘要:ShowstopperTime Limit:1000MSMemory Limit:65536KTotal Submissions:1060Accepted:303DescriptionData-mining huge data sets can be a painful and long lasting process if we are not aware of tiny patterns existing within those data sets.One reputable company has recently discovered a tiny bug in their hard
阅读全文
摘要:Moo University - Financial AidTime Limit:1000MSMemory Limit:30000KTotal Submissions:4235Accepted:1293DescriptionBessie noted that although humans have many universities they can attend, cows have none. To remedy this problem, she and her fellow cows formed a new university called The University of W
阅读全文
摘要:Telephone LinesTime Limit:1000MSMemory Limit:65536KTotal Submissions:4591Accepted:1693DescriptionFarmer John wants to set up a telephone line at his farm. Unfortunately, the phone company is uncooperative, so he needs to pay for some of the cables required to connect his farm to the phone system.The
阅读全文
摘要:MatrixTime Limit:6000MSMemory Limit:65536KTotal Submissions:4428Accepted:1102DescriptionGiven aN×Nmatrix A, whose element in thei-th row andj-th columnAijis an number that equalsi2+ 100000 ×i+j2- 100000 ×j+i×j, you are to find theM-th smallest element in the matrix.InputThe first
阅读全文
摘要:Dropping testsTime Limit:1000MSMemory Limit:65536KTotal Submissions:5459Accepted:1889DescriptionIn a certain course, you takentests. If you getaiout ofbiquestions correct on testi, your cumulative average is defined to be.Given your test scores and a positive integerk, determine how high you can mak
阅读全文
摘要:K BestTime Limit: 8000MSMemory Limit: 65536KTotal Submissions: 5177Accepted: 1411Case Time Limit: 2000MSSpecial JudgeDescriptionDemy has n jewels. Each of her jewels has some value vi and weight wi.Since her husband John got broke after recent financial crises, Demy has decided to sell some jewels.
阅读全文
摘要:MedianTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 3528Accepted: 1001DescriptionGiven N numbers, X1, X2, ... , XN, let us calculate the difference of every pair of numbers: ∣Xi - Xj∣ (1 ≤ i < j ≤ N). We can get C(N,2) differences through this work, and now your task is to find the median
阅读全文
摘要:DryingTime Limit:2000MSMemory Limit:65536KTotal Submissions:7959Accepted:2014DescriptionIt is very hard to wash and especially to dry clothes in winter. But Jane is a very smart girl. She is not afraid of this boring process. Jane has decided to use a radiator to make drying faster. But the radiator
阅读全文
摘要:River HopscotchTime Limit: 2000MSMemory Limit: 65536KTotal Submissions: 5961Accepted: 2579DescriptionEvery year the cows hold an event featuring a peculiar version of hopscotch that involves carefully jumping from rock to rock in a river. The excitement takes place on a long, straight river with a r
阅读全文

浙公网安备 33010602011771号