摘要:
告知每次要插到第i个位置上,问最后它们的顺序是什么。这一题,不是考线段树,是考如何想出用线段树...思维很巧妙,倒过来做的话就能确定此人所在的位置....线段树每个结点有一个remain域,记录些线段还有多少个空位....开始时,叶结点的remain当然为1 Buy TicketsTime Limit : 8000/4000ms (Java/Other)Memory Limit : 131072/65536K (Java/Other)Total Submission(s) : 10Accepted Submission(s) : 5Problem DescriptionRailway tick 阅读全文
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1394 Minimum Inversion NumberTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 8205Accepted Submission(s): 5041 Problem DescriptionThe inversion number of a given number sequence a1, a2, ..., an is the numbe 阅读全文
摘要:
BillboardTime Limit : 20000/8000ms (Java/Other)Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 12Accepted Submission(s) : 6Problem DescriptionAt the entrance to the university, there is a huge rectangular billboard of size h*w (h is its height and w is its width). The board is the pla. 阅读全文
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1556 Color the ballTime Limit: 9000/3000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 6567Accepted Submission(s): 3448 Problem DescriptionN个气球排成一排,从左到右依次编号为1,2,3....N.每次给定2个整数a b(a #include#define maxn 500004 struct node {.. 阅读全文
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1754记住那让自己wa的地方。 I Hate ItTime Limit: 9000/3000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 29300Accepted Submission(s): 11615 Problem Description很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。 这让很多学生很反感。不管你喜不喜欢,现在需要你做的是,就是按照老师的. 阅读全文
摘要:
敌兵布阵Time Limit : 2000/1000ms (Java/Other)Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 14Accepted Submission(s) : 6Problem DescriptionC国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都有可能发. 阅读全文
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1412{A} + {B}Time Limit: 10000/5000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 9663Accepted Submission(s): 4002 Problem Description给你两个集合,要求{A} + {B}. 注:同一个集合中不会有两个相同的元素.Input每组输入数据分为三行,第一行有两个数字n,m(0 2 #include 3 using nam 阅读全文
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1406 完数Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 15365Accepted Submission(s): 5592 Problem Description完数的定义:如果一个大于1的正整数的所有因子之和等于它的本身,则称这个数是完数,比如6,28都是完数:6=1+2+3;28=1+2+4+7+14。本题的任务是判断两个正整数之间完数的个数。Inp 阅读全文
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1395怎样取余是关键。。 2^x mod n = 1Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 9534Accepted Submission(s): 2932 Problem DescriptionGive a number n, find the minimum x(x>0) that satisfies 2^x mod n = 1.Input 阅读全文
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1391Number StepsTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 3280Accepted Submission(s): 2030 Problem DescriptionStarting from point (0,0) on a plane, we have written all non-negative integers 0, 1, 2,. 阅读全文