随笔分类 - ACM---不光是查找值!“二分搜索”
摘要:Problem Description ztr loves lucky numbers. Everybody knows that positive integers are lucky if their decimal representation doesn't contain digits o
阅读全文
摘要:Description: You are given a matrix which is n rows m columns (1 yj的边,然后对二分图跑最大匹配,如果最大匹配数>=n-k+1,则ansmid 1 #pragma comment(linker, "/STACK:102400000...
阅读全文
摘要:DescriptionAfter a day trip with his friend Dick, Harry noticed a strange pattern of tiny holes in the door of his SUV. The local American Tire store ...
阅读全文
摘要:Problem DescriptionMr. West bought a new car! So he is travelling around the city.One day he comes to a vertical corner. The street he is currently in...
阅读全文
摘要:Problem DescriptionIn the Dark forest, there is a Fairy kingdom where all the spirits will go together and Celebrate the harvest every year. But there...
阅读全文
摘要:DescriptionFarmer John's farm has N barns, and there are some cows that live in each barn. The cows like to drop around, so John wants to build some r...
阅读全文
摘要:DescriptionRatish is a young man who always dreams of being a hero. One day his friend Luffy was caught by Pirate Arlong. Ratish set off at once to Ar...
阅读全文
摘要:Problem DescriptionXiao Ming is a citizen who's good at playing,he has lot's of gold cones which have square undersides,let's call them pyramids.Anyon...
阅读全文
摘要:Problem Description我们有一个数列A1,A2...An,你现在要求修改数量最少的元素,使得这个数列严格递增。其中无论是修改前还是修改后,每个元素都必须是整数。请输出最少需要修改多少个元素。Input第一行输入一个T(1≤T≤10),表示有多少组数据每一组数据:第一行输入一个N(1≤...
阅读全文
摘要:Problem Description给定序列A={A1,A2,...,An}, 要求改变序列A中的某些元素,形成一个严格单调的序列B(严格单调的定义为:Bi 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 us...
阅读全文
摘要:DescriptionThe 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 wi...
阅读全文
摘要:DescriptionFarmer 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...
阅读全文
摘要:DescriptionGiven a N × N matrix A, whose element in the i-th row and j-th column Aij is an number that equals i2 + 100000 × i + j2 - 100000 × j + i × ...
阅读全文
摘要:DescriptionGiven 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) d...
阅读全文
摘要:DescriptionFarmer John's N (1 =w1-s2,即w2+s2>=w1+s1,所以和最大的就该老实的在下面呆着= =! 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 using name...
阅读全文
摘要:DescriptionDemy 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 ...
阅读全文
摘要:DescriptionIn a certain course, you take n tests. If you get ai out of bi questions correct on test i, your cumulative average is defined to be ..Gi...
阅读全文
摘要:DescriptionIt 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. J...
阅读全文
摘要:DescriptionFarmer John is an astounding accounting wizard and has realized he might run out of money to run the farm. He has already calculated and re...
阅读全文
摘要:DescriptionFarmer John has built a new long barn, with N (2 2 #include 3 #include 4 #include 5 #include 6 #include 7 using namespace std; 8 #define N...
阅读全文