
二分
Kirito_Acmer
这个作者很懒,什么都没留下…
展开
-
hdu3564 Another LIS
Problem DescriptionThere is a sequence firstly empty. We begin to add number from 1 to N to the sequence, and every time we just add a single number to the sequence at a specific position. Now, we w原创 2015-05-28 12:42:26 · 862 阅读 · 0 评论 -
hdu5884 Sort(二分)
Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 547 Accepted Submission(s): 101Problem DescriptionRecently, Bob has just learnt原创 2016-09-17 20:38:07 · 733 阅读 · 0 评论 -
zjnu1786 PROSJEK(二分)
DescriptionSample Input4 11 2 3 4Sample Output4.000000题意:给你n个数,让你找到长度大于等于k的连续串的最大平均值。思路:我们可以二分答案,然后先把每一个数减去二分的平均值,记录前缀和sum[i],用从k开始循环,每次往后找一个数,都减去0~i-k中的最小前缀和,看最大算出来的值是不是大于等于0,如果大于等于0就满原创 2016-03-27 21:45:09 · 566 阅读 · 0 评论 -
fzu2178礼物分配 (状压+二分)
Problem Description在双胞胎兄弟Eric与R.W的生日会上,他们共收到了N个礼物,生日过后他们决定分配这N个礼物(numv+numw=N)。对于每个礼物他们俩有着各自心中的价值vi和wi,他们要求各自分到的礼物数目|numv-numw| Input第一行为一个整数表示数据组数T。 接下来T组数组,每组数据第一行为一个整数N。(N Output对于每原创 2016-02-23 20:17:39 · 769 阅读 · 0 评论 -
最长下降序列——中高级
Description给你一串整数,从左到右按顺序挑出一些数字,构成严格下降序列,问最长能构成多长如6个数4 5 2 4 2 2, 那么最长可以挑出5 4 2,长度为3Input首先输出T(T每组数据: 首先输入n表示有几个数(1后面一行跟着n个整数Output对于每个样例输出一个数字,表示最长的长度Sample Input164 5原创 2015-05-28 18:38:05 · 970 阅读 · 0 评论 -
hdu2141 Can you find it? (二分)
Problem DescriptionGive 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, which satisfy the formula Ai+Bj原创 2016-02-21 21:31:14 · 509 阅读 · 0 评论 -
hdu5442 Favorite Donut
Problem DescriptionLulu has a sweet tooth. Her favorite food is ring donut. Everyday she buys a ring donut from the same bakery. A ring donut is consists of n parts. Every part has its own sugar原创 2015-09-14 12:43:17 · 637 阅读 · 0 评论 -
codeforces578C. Weakness and Poorness
time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a sequence of n integers a1, a2, ..., an.Deter原创 2015-09-17 11:40:13 · 780 阅读 · 0 评论 -
poj2018 Best Cow Fences
Time Limit: 1000MS Memory Limit: 30000KTotal Submissions: 9985 Accepted: 3237DescriptionFarmer John's farm consists of a long row of N (1 FJ wants to build a fence arou原创 2015-09-24 20:04:51 · 3090 阅读 · 2 评论 -
Gym 100803G Flipping Parentheses
题目链接:http://codeforces.com/gym/100803/attachments/download/3816/20142015-acmicpc-asia-tokyo-regional-contest-en.pdf题意:给你一些匹配好的括号,长为n,有m个操作,每次操作把其中一个"("改为")",或者把其中一个")"改为"(",问你改动一个单括号,使得改后的括号序列任然完美匹配原创 2015-11-08 21:28:49 · 726 阅读 · 0 评论 -
codeforces 492D. Vanya and Computer Game
time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputVanya and his friend Vova play a computer game where they need t原创 2015-11-04 16:00:26 · 606 阅读 · 0 评论 -
hdu5432 Pyramid Split
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.Anyone of them can be defined by the square's l原创 2015-09-13 18:04:38 · 701 阅读 · 0 评论 -
lower_bound()和upper_bound
转载自飘过的小牛,原网址:http://blog.youkuaiyun.com/niushuai666/article/details/6734403函数lower_bound()在first和last中的前闭后开区间进行二分查找,返回大于或等于val的第一个元素位置。如果所有元素都小于val,则返回last的位置举例如下:一个数组number序列为:4,10,11,30,69,7原创 2015-05-31 19:55:47 · 2029 阅读 · 0 评论 -
hdu5233 Gunner II
Problem DescriptionLong long ago, there was a gunner whose name is Jack. He likes to go hunting very much. One day he go to the grove. There are n birds and n trees. The i-th bird stands on the to原创 2015-06-09 18:53:16 · 740 阅读 · 0 评论 -
hdu5246 超级赛亚ACMer
Problem Description百小度是一个ACMer,也是一个超级赛亚人,每个ACMer都有一个战斗力,包括百小度。 所谓超级赛亚人的定义,是说如果在对抗中刚好接近极限状态,那就会激发斗志,实力提升.具体来说,就是百小度现在要接受一些ACMer的挑战了,这些ACMer有n个人,第i个人的战斗力是a[i]。 百小度接下来可以自主安排与这n个AC原创 2015-06-09 12:35:19 · 1140 阅读 · 0 评论 -
codeforces Looksery Cup 2015 H Degenerate Matrix
The determinant of a matrix 2 × 2 is defined as follows:A matrix is called degenerate if its determinant is equal to zero.The norm ||A|| of a matrix A is defined as a maximum of absolute v原创 2015-06-07 13:13:40 · 1370 阅读 · 3 评论 -
hdu5726 GCD(gcd +二分+rmq)
Problem DescriptionGive you a sequence of N(N≤100,000) integers : a1,...,an(0ai≤1000,000,000). There are Q(Q≤100,000) queries. For each query l,r you have to calculate gcd(al,,al+1,...,ar)原创 2016-07-19 20:40:59 · 1184 阅读 · 2 评论