
解题报告
文章平均质量分 75
userluoxuan
这个作者很懒,什么都没留下…
展开
-
Balanced Lineup(RMQ)
解题思路:用RMQ求出各区间的最大最小值,原创 2014-08-16 20:19:18 · 719 阅读 · 0 评论 -
昂贵的聘礼(最短路)
Description年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探险家拿不出这么多金币,便请求酋长降低要求。酋长说:"嗯,如果你能够替我弄到大祭司的皮袄,我可以只要8000金币。如果你能够弄来他的水晶球,那么只要5000金币就行了。"探险家就跑到大祭司那里,向他要求皮袄或水晶球,大祭司要他用原创 2014-07-29 19:59:58 · 610 阅读 · 0 评论 -
Matches Game(尼姆博弈)
解题思路:尼姆博弈模板题。AC代码:原创 2014-07-31 23:47:07 · 509 阅读 · 0 评论 -
取(2堆)石子游戏(威佐夫博弈)
解题思路:这题是彻底原创 2014-08-01 17:23:12 · 610 阅读 · 0 评论 -
一元三次方程求解(折半查找)
Description有形如:ax3+bx2+cx+d=0 这样的一个一元三次方程。给出该方程中各项的系数(a,b,c,d 均为实数),并约定该方程存在三个不同实根(根的范围在-100至100之间),且根与根之差的绝对值>=1。请你求出这个方程的三个实根。Input只有一行,包括4个实数a,b,c,d,中间用一个或多个空格隔开。Output只原创 2014-07-12 14:55:39 · 1097 阅读 · 0 评论 -
Stars(树状数组)
解题思路:题目一开始没看懂,读了半天才知道是一颗原创 2014-07-28 20:34:35 · 488 阅读 · 0 评论 -
最短路(最短路)
解题思路:我选择用Floyd算法来做,代码原创 2014-07-28 14:15:59 · 555 阅读 · 0 评论 -
畅通工程续(最短路)
解题思路:我用Dijkstra来做原创 2014-07-28 14:18:54 · 458 阅读 · 0 评论 -
敌兵布阵(树状数组)
解题思路:最基础的树状数组,原创 2014-07-28 17:29:56 · 485 阅读 · 0 评论 -
Japan(树状数组)
DescriptionJapan plans to welcome the ACM ICPC World Finals and a lot of roads must be built for the venue. Japan is tall island with N cities on the East coast and M cities on the West coast (M原创 2014-07-29 21:56:28 · 744 阅读 · 0 评论 -
Mobile phones(二维树状数组)
解题思路:完全就是二维树状数组的模板原创 2014-07-30 12:57:56 · 488 阅读 · 0 评论 -
取(m堆)石子游戏(尼姆博弈)
解题思路:基本的尼姆博弈类型题,还要输出第一次的方案,只需要原创 2014-08-01 16:59:01 · 553 阅读 · 0 评论 -
选课(next_permutatition)
Description教务网站如期的在选课之日出问题了,这次的问题是登陆窗口的验证码无法显示了,同学们只能靠猜验证码来登陆选课。教务的登陆系统刚刚经过改进,改进后的验证码均为1..N的一个排列。一般的同学们在试验的时候都是按照所有排列的字典序逐个试验,但是SCat发掘这样试验很乏味,所以他决定每次尝试前一个排列后面的第M个排列。但是一段时间之后他发现,寻找一个排列后面的第M个排列并原创 2014-07-12 11:14:29 · 677 阅读 · 0 评论 -
小镇网(最小生成树)
Description农民约翰被选为他们镇的镇长!他其中一个竞选承诺就是在镇上建立起互联网,并连接到所有的农场。当然,他需要你的帮助。约翰已经给他的农场安排了一条高速的网络线路,他想把这条线路共享给其他农场。为了使花费最少,他想铺设最短的光纤去连接所有的农场。你将得到一份各农场之间连接费用的列表,你必须找出能连接所有农场并所用光纤最短的方案。每两个农场间的距离不会超过100000原创 2014-07-14 23:21:06 · 1347 阅读 · 1 评论 -
Paid Roads(DFS)
解题思路:这题一开始以为是最短路类型的,后来发现,原创 2014-07-29 16:57:14 · 514 阅读 · 0 评论 -
UFOs(三维树状数组)
解题思路:貌似原创 2014-07-30 14:07:25 · 572 阅读 · 0 评论 -
Just the Facts
解题思路:千万别看到阶层就以为是原创 2014-07-31 14:55:33 · 575 阅读 · 0 评论 -
青蛙的约会(扩展欧几里得)
解题思路:设走了s步,则原创 2014-08-06 17:13:10 · 521 阅读 · 0 评论 -
Wolf and Rabbit(最大公约数)
解题思路:题目大意是给几个洞,狼从第1个原创 2014-08-06 19:16:15 · 588 阅读 · 0 评论 -
Mayor's posters(线段树 + 离散化)
DescriptionThe citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral posters at all places at their whim. The city coun原创 2014-08-14 15:50:50 · 1263 阅读 · 2 评论 -
Coder(暴力)
解题思路:本来该题是应该用线段树来原创 2014-08-14 15:10:12 · 545 阅读 · 0 评论 -
Crane(线段树)
DescriptionACM has bought a new crane (crane -- jeřáb) . The crane consists of n segments of various lengths, connected by flexible joints. The end of the i-th segment is joined to the beginning原创 2014-08-14 15:17:42 · 1173 阅读 · 1 评论 -
A Simple Problem with Integers(线段树)
解题思路:区间更新,区间求和的模板题。AC代码:原创 2014-08-14 15:15:35 · 519 阅读 · 0 评论 -
Panda(线段树)
解题思路:用每个字符的下标记录原创 2014-08-14 16:19:59 · 768 阅读 · 0 评论 -
Billboard(线段树)
解题思路:题目大意是原创 2014-08-11 17:22:34 · 472 阅读 · 0 评论 -
Minimum Inversion Number(线段树)
解题思路:用线段树求逆序对。只需要原创 2014-08-11 17:07:19 · 691 阅读 · 1 评论 -
I Hate It(线段树)
解题思路:线段树,点更新,求原创 2014-08-11 17:05:44 · 475 阅读 · 0 评论 -
Babelfish(字典树 or map)
解题思路:这题用字典树做可以,用map映射做也可以,当然字典树效率原创 2014-08-08 14:43:07 · 630 阅读 · 0 评论 -
Phone List(字典树 or 排序)
DescriptionGiven a list of phone numbers, determine if it is consistent in the sense that no number is the prefix of another. Let’s say the phone catalogue listed these numbers:1. Emergency 911原创 2014-08-08 11:23:09 · 889 阅读 · 0 评论 -
Word Puzzles(字典树)
DescriptionWord puzzles are usually simple and very entertaining for all ages. They are so entertaining that Pizza-Hut company started using table covers with word puzzles printed on them, possi原创 2014-08-08 15:00:09 · 2276 阅读 · 0 评论 -
Shortest Prefixes(字典树)
解题思路:和前面一道原创 2014-08-08 12:06:32 · 545 阅读 · 0 评论 -
Prime Distance(二次筛素数)
DescriptionThe branch of mathematics called number theory is about properties of numbers. One of the areas that has captured the interest of number theoreticians for thousands of years is the qu原创 2014-08-06 17:16:10 · 1591 阅读 · 0 评论 -
Goldbach's Conjecture(筛选法求素数)
解题思路:筛选法求素数模板题,原创 2014-08-08 20:34:02 · 548 阅读 · 0 评论 -
IMMEDIATE DECODABILITY(字典树)
解题思路:这题和之前的原创 2014-08-08 14:57:19 · 463 阅读 · 0 评论 -
Exponentiation(高精度)
DescriptionProblems involving the computation of exact values of very large magnitude and precision are common. For example, the computation of the national debt is a taxing experience for many原创 2014-07-31 15:09:35 · 763 阅读 · 0 评论 -
合唱队形(动态规划)
DescriptionN位同学站成一排,音乐老师要请其中的(N-K)位同学出列,使得剩下的K位同学排成合唱队形。 合唱队形是指这样的一种队形:设K位同学从左到右依次编号为1, 2, …, K,他们的身高分别为T1, T2, …, TK,则他们的身高满足T1 Ti+1 > … > TK (1 你的任务是,已知所有N位同学的身高,计算最少需要几位同学出列,可以使得剩下的同学排成合唱队原创 2014-07-10 22:41:22 · 7844 阅读 · 4 评论 -
How many Fibs?(高精度)
DescriptionRecall the definition of the Fibonacci numbers: f1 := 1 f2 := 2 fn := fn-1 + fn-2 (n>=3) Given two numbers a and b, calculate how many Fibonacci numbers are in the range原创 2014-07-31 14:42:38 · 918 阅读 · 0 评论 -
Prime Ring Problem(DFS)
解题报告:原创 2014-07-26 22:09:09 · 443 阅读 · 0 评论 -
Dating with girls(1)
解题思路:先制定一个数,然后在后面进行原创 2014-07-26 22:14:47 · 686 阅读 · 0 评论 -
FLIP GAME
解题思路:题目大意是翻转一枚硬币,则原创 2014-07-26 22:59:25 · 507 阅读 · 0 评论