二分搜索
u010660276
这个作者很懒,什么都没留下…
展开
-
Good Bye 2016
一年多没有搞ACM了,怀念原来沉浸在ACM的每时每刻,怀念它带给我的点点滴滴 --序言 闲来无事想重温一下,发现思维有些卡顿了,以后还是要多做做cf,开拓思维。 C题: 题意:Limak参加了N场cf比赛,给出每一场的rating和,当场的division,问参加完N场之后,最多有多少分。 思路:从最后原创 2017-01-08 14:29:23 · 519 阅读 · 0 评论 -
树状数组+离线+hdu4605
Online JudgeOnline ExerciseOnline TeachingOnline ContestsExercise AuthorF.A.QHand In HandOnline AcmersForum | DiscussStatistical ChartsProblem ArchiveRealtime Judge Statu原创 2014-09-22 21:40:40 · 454 阅读 · 0 评论 -
线段树+树状数组+二分+划分树+主席树+hdu4417
Online JudgeOnline ExerciseOnline TeachingOnline ContestsExercise AuthorF.A.QHand In HandOnline AcmersForum | DiscussStatistical ChartsProblem ArchiveRealtime Judge Statu原创 2014-08-07 11:19:56 · 843 阅读 · 0 评论 -
Codeforces Round #262 (Div. 2)思维训练
A. Vasya and SocksVasya has n pairs of socks. In the morning of each day Vasya has to put on a pair of socks before he goes to school. When he comes home in the evening, Vasya takes off the used原创 2014-08-21 16:09:39 · 517 阅读 · 0 评论 -
后缀数组poj1226
题意:求最长的公共子串,使她后者是他的翻转串在每个原创 2014-07-30 16:30:22 · 477 阅读 · 0 评论 -
多校训练
I - The old PadawanTime Limit:500MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionYoda: Use the Force. Yes. Now, the stone. Feel it. Concentra原创 2014-07-28 19:46:21 · 551 阅读 · 0 评论 -
Codeforces Round #247 (Div. 2)
C. k-TreeQuite recently a creative student Lesha had a lecture on trees. After the lecture Lesha was inspired and came up with the tree of his own which he called ak-tree.A k-tree is an in原创 2014-06-20 14:53:59 · 564 阅读 · 0 评论 -
后缀数组+二分poj3261
题意:找出一个最长的并且重复次数至少为k次的子串。原创 2014-07-01 11:43:06 · 439 阅读 · 0 评论 -
二分
Bet原创 2014-06-17 19:50:12 · 408 阅读 · 0 评论 -
二分边界
二分区间可以是左闭右开,或者都闭也行。 如果是都闭,判断条件是while(L 总之二分的条件很灵活,判断条件也可以是L 如果二分浮点型的就不会出现这样的问题。转载 2014-06-09 14:50:20 · 586 阅读 · 0 评论 -
Codeforces Round #256 (Div. 2)思维训练
B. Suffix StructuresBizon the Champion isn't just a bison. He also is a favorite of the "Bizons" team.At a competition the "Bizons" got the following problem: "You are given two distinct wor原创 2014-07-19 13:20:30 · 766 阅读 · 0 评论 -
二分|hash(找正方形)poj2002
Language:DefaultSquaresTime Limit: 3500MS Memory Limit: 65536KTotal Submissions: 16255 Accepted: 6181DescriptionA square is a 4-sided polygon whose sides原创 2014-09-29 19:37:36 · 598 阅读 · 0 评论 -
Codeforces Round #275 (Div. 2)B
B. Friends and Presentstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou have two friends. You want to present each原创 2014-10-28 19:34:59 · 395 阅读 · 0 评论 -
伸展树+二分hdu3436(多校联合)
Online JudgeOnline ExerciseOnline TeachingOnline ContestsExercise AuthorF.A.QHand In HandOnline AcmersForum | DiscussStatistical ChartsProblem ArchiveRealtime Judge Statu原创 2014-12-04 11:57:33 · 495 阅读 · 0 评论 -
二维数组中查找
在一个二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。 bool Find(vector<vector<int> > array,int target) { int col=array.size()-1,row=0; while(col>=0&&row<ar原创 2015-09-05 20:10:52 · 265 阅读 · 0 评论 -
旋转数组
上次去阿里面试的题目,当时写的那叫搓啊。。。题目描述 把一个数组最开始的若干个元素搬到数组的末尾,我们称之为数组的旋转。输入一个非递减序列的一个旋转,输出旋转数组的最小元素。例如数组{3,4,5,1,2}为{1,2,3,4,5}的一个旋转,该数组的最小值为1。 思路网上都有,这里给出实现:int minNumberInRotateArray(vector<int> rotateArray) {原创 2015-09-05 21:09:24 · 407 阅读 · 0 评论 -
hdu 4495 - Rectangle(hash+二分+dp)
Rectangle Time Limit: 10000/10000 MS (Java/Others) Memory Limit: 65535/102400 K (Java/Others) Total Submission(s): 344 Accepted Submission(s): 100Problem Description Given a rectangle which co原创 2015-07-11 22:28:37 · 598 阅读 · 0 评论 -
Codeforces Round #307 (Div. 2)(二分||位运算+矩阵快速幂||分块)
B. ZgukistringZProfessor GukiZ doesn't accept string as they are. He likes to swap some letters in string to obtain a new one.GukiZ has strings a, b, and c. He wants to obtain stringk by原创 2015-06-14 21:36:32 · 610 阅读 · 0 评论 -
2015年百度之星初赛(hdu5246-5251)
超级赛亚ACMer Accepts: 868 Submissions: 5329 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Problem Description百小度是一个ACMer,也是一个超级赛亚人,每个A原创 2015-05-31 12:34:01 · 945 阅读 · 0 评论 -
树分治(hdu5016-2014西安现场赛)
Mart Master IITime Limit: 12000/6000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 328 Accepted Submission(s): 108Problem DescriptionTrader Dogy live原创 2015-04-25 10:26:47 · 1341 阅读 · 0 评论 -
二分(hdu5200)
TreesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 537 Accepted Submission(s): 177Problem DescriptionToday CodeFamer is going t原创 2015-04-06 22:39:01 · 493 阅读 · 0 评论 -
树套树(树链剖分+线段树+Treap)BZOJ1146
树套树原创 2015-02-09 18:11:00 · 538 阅读 · 0 评论 -
线段树+二分(Codeforces Round #291 (Div. 2)D. R2D2 and Droid Army)
D. R2D2 and Droid ArmyAn army of n droids is lined up in one row. Each droid is described bym integers a1, a2, ..., am, whereai is the number of details of thei-th type in this droid's m原创 2015-02-17 15:30:29 · 639 阅读 · 0 评论 -
Codeforces Round #283 (Div. 2)D(good)
D. Tennis Gametime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPetya and Gena love playing table tennis. A single mat原创 2014-12-23 23:05:47 · 472 阅读 · 0 评论 -
拓扑排序+二分
acdream第一次写拓扑排序,原创 2014-06-09 15:08:34 · 544 阅读 · 0 评论 -
离散化+枚举
http://acm.upc.edu.cn/problem.php?id=2525把坐标离散化到n*n的网格中,然后统计离散化后(x,y)点到(0,0)点包含多少个点。二分答案,判断是否可行。#include#include#include#include#includeusing namespace std;const int maxn=1500;const int INF原创 2014-03-16 21:01:42 · 762 阅读 · 0 评论 -
二分uva501
思路:vector保存元素,每次插入的时候二分位置,然后插入,询问的时候直接用下标操作#include#include#include#includeusing namespace std;const int maxn=30010;int n,m;int add[maxn];void solve(){ vector a; int x,j=1; for(原创 2014-03-01 21:02:29 · 536 阅读 · 0 评论 -
两次二分搜索--poj3685
Language:DefaultMatrixTime Limit: 6000MS Memory Limit: 65536KTotal Submissions: 4312 Accepted: 1063DescriptionGiven a N × N matrix A, whose element in the原创 2013-11-21 12:43:27 · 837 阅读 · 0 评论 -
二分搜索(两次)-poj3579
Language:DefaultMedianTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 3418 Accepted: 944DescriptionGiven N numbers, X1, X2, ... , XN, let us c原创 2013-11-21 11:08:23 · 1937 阅读 · 0 评论 -
二分
Language:DefaultK BestTime Limit: 8000MS Memory Limit: 65536KTotal Submissions: 4894 Accepted: 1331Case Time Limit: 2000MS Special JudgeDescription原创 2013-11-19 20:51:47 · 981 阅读 · 0 评论 -
01分数规划+二分搜索
Language:DefaultDropping testsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 5119 Accepted: 1770DescriptionIn a certain course, you take n test原创 2013-11-19 15:31:19 · 932 阅读 · 0 评论 -
01分数规划【最优比率环】--poj3621
01分数规划,又称参数搜索。即求形如(∑Di*xi)/(∑Ci*xi)的最值问题,其中xi={0,1}即只有取或不取2种状态。设最值为ans则必有∑(Di-ans*Ci)*xi=0,且因为Di和Ci都是给定的,当xi确定时,等式左边可以看成是一个以ans为变量的单调函数。因此求最优解转化为求解方程跟的问题。此题是对01分数规划的应用,那么首先明白01分数规划的思想.01分数规划的思想的描述原创 2013-11-01 20:00:22 · 842 阅读 · 0 评论 -
最小值最大化-poj3273
题意:农夫把月份分为M分,每天花费a,问每份的和的最小值。思路:二分枚举答案。#include#include#include#include#include#include#include#include#include#include#includetypedef long long LL;using namespace std;const int INF原创 2013-10-22 13:56:16 · 535 阅读 · 0 评论 -
最小值最大化
Language:DefaultRiver HopscotchTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 5504 Accepted: 2391DescriptionEvery year the cows hold an event f原创 2013-10-20 20:15:47 · 1646 阅读 · 0 评论 -
二分搜索--poj3104
Language:DefaultDryingTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 7269 Accepted: 1873DescriptionIt is very hard to wash and especially to dr原创 2013-10-25 22:05:15 · 755 阅读 · 0 评论 -
二分图多重匹配+二分枚举-poj2112
Language:DefaultOptimal MilkingTime Limit: 2000MS Memory Limit: 30000KTotal Submissions: 10381 Accepted: 3768Case Time Limit: 1000MSDescriptionFJ ha原创 2013-10-06 14:13:35 · 802 阅读 · 0 评论 -
二分搜索求最大值最小化--poj2456
Language:DefaultAggressive cowsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 4840 Accepted: 2375DescriptionFarmer John has built a new long ba原创 2013-09-19 16:26:55 · 1339 阅读 · 0 评论 -
二分使第K个数尽量大--poj2010
Language:DefaultMoo University - Financial AidTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 3892 Accepted: 1159DescriptionBessie noted that al原创 2013-11-22 22:57:53 · 827 阅读 · 0 评论 -
二分+SPFA--poj3662
Language:DefaultTelephone LinesTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 4397 Accepted: 1607DescriptionFarmer John wants to set up a tel原创 2013-11-23 21:57:23 · 1064 阅读 · 0 评论 -
推公式+二分--poj1759
公式:Hn=(n-1)*H2+(n-2)*(n-1)-(n-2)*H1代码如下:#include#includeusing namespace std;const double eps=1e-8;int N;double A;double cal(double mid,int n){ return (n-1)*mid+(n-2)*(n-1)-(n-2)*A;}bo原创 2013-11-24 13:36:59 · 662 阅读 · 0 评论