二分
Cherish_lii
这个作者很懒,什么都没留下…
展开
-
二分
转自https://blog.csdn.net/weixin_42165981/article/details/87277006?tdsourcetag=s_pctim_aiomsg 查找最后一个等于x的元素: int search(const int *a,int n,int key) { int l=0,r=n-1,mid=0,ans=0; while(l<...原创 2019-02-15 11:57:06 · 134 阅读 · 1 评论 -
Funky Numbers _CF192A
题目 As you very well know, this year's funkiest numbers are so called triangular numbers (that is, integers that are representable as , where k is some positive integer), and the coolest numbers are...原创 2019-02-12 12:36:18 · 244 阅读 · 1 评论 -
Frodo and pillows _CF760B
题目 n hobbits are planning to spend the night at Frodo's house. Frodo has n beds standing in a row and m pillows (n ≤ m). Each hobbit needs a bed and at least one pillow to sleep, however, everyone ...原创 2019-02-12 14:38:33 · 305 阅读 · 0 评论 -
Aggressive cows _POJ2456
题目 Farmer John has built a new long barn, with N (2 <= N <= 100,000) stalls. The stalls are located along a straight line at positions x1,...,xN (0 <= xi <= 1,000,000,000). His C (2 <...原创 2019-02-12 15:03:52 · 151 阅读 · 0 评论 -
Pie _HDU1969
题目 My birthday is coming up and traditionally I'm serving pie. Not just one pie, no, I have a number N of them, of various tastes and of various sizes. F of my friends are coming to my party and...原创 2019-02-12 15:49:43 · 185 阅读 · 0 评论 -
4 Values whose Sum is 0_POJ2758
题目 The 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 + c + d = 0 . In the fo...原创 2019-02-12 16:14:47 · 243 阅读 · 0 评论