- 博客(48)
- 收藏
- 关注
原创 POJ 3984 迷宫问题(BFS)
Description定义一个二维数组: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0,};它表示一个迷宫,其中的1表示墙壁,0表示可以走的路,只能横着走或竖着走,不能斜着走,要求编程序找出从左上角到右下角的最短
2015-03-26 21:36:28
441
原创 HDU 2181 哈密顿绕行世界问题(DFS)
Description一个规则的实心十二面体,它的 20个顶点标出世界著名的20个城市,你从一个城市出发经过每个城市刚好一次后回到出发的城市。 Input前20行的第i行有3个数,表示与第i个城市相邻的3个城市.第20行以后每行有1个数m,m=1.m=0退出. Output输出从第m个城市出发经过每个城市1次又回到
2015-03-26 19:04:30
692
原创 POJ 3669Meteor Shower(广搜)
DescriptionBessie hears that an extraordinary meteor shower is coming; reports say that these meteors will crash into earth and destroy anything they hit. Anxious for her safety, she vows to fin
2015-03-26 18:59:00
499
原创 UVA - 10905 Children's Game(字典序)
Description4thIIUCInter-University Programming Contest, 2005AChildren’s GameInput: standard inputOutput: standard outputProblemsetter: Md. Kamruzz
2015-03-13 16:09:45
437
原创 UVA - 10382 Watering Grass(贪心)
DescriptionProblem EWatering GrassInput: standard inputOutput: standard outputTime Limit: 3 secondsn sprinklers are installed in a horizontal strip of grass l meters long and w meters wide
2015-03-13 16:06:34
466
原创 HDU - 1318 Palindromes(字符串)
DescriptionA regular palindrome is a string of numbers or letters that is the same forward as backward. For example, the string "ABCDEDCBA" is a palindrome because it is the same when the string i
2015-03-13 15:59:04
492
原创 POJ - 3646 The Dragon of Loowater(贪心)
DescriptionOnce upon a time, in the Kingdom of Loowater, a minor nuisance turned into a major problem.The shores of Rellau Creek in central Loowater had always been a prime breeding ground f
2015-03-13 15:54:18
420
原创 HDU - 2570 迷瘴(贪心)
Description通过悬崖的yifenfei,又面临着幽谷的考验―― 幽谷周围瘴气弥漫,静的可怕,隐约可见地上堆满了骷髅。由于此处长年不见天日,导致空气中布满了毒素,一旦吸入体内,便会全身溃烂而死。 幸好yifenfei早有防备,提前备好了解药材料(各种浓度的万能药水)。现在只需按照配置成不同比例的浓度。 现已知yifenfei随身携带有n种浓度的万能药水,体积V都相同,浓
2015-03-13 15:52:57
747
原创 HDU - 1789 Doing Homework again(贪心)
DescriptionIgnatius has just come back school from the 30th ACM/ICPC. Now he has a lot of homework to do. Every teacher gives him a deadline of handing in the homework. If Ignatius hands in the ho
2015-03-13 15:50:31
500
原创 UVA - 12657 Boxes in a Line(双向链表)
#include #include #include #include using namespace std;const int maxn = 100000+5;int n,m;int Left[maxn],Right[maxn];void link(int L ,int R){ Right[L] = R,Left[R] = L;}int main(){
2015-03-05 13:46:28
363
原创 UVA - 11988 Broken Keyboard (a.k.a. Beiju Text)链表
DescriptionProblem BBroken Keyboard (a.k.a. Beiju Text)You're typing a long text with a broken keyboard. Well it's not so badly broken. The only problem with the keyboard is that sometimes
2015-03-05 13:32:40
481
原创 UVA - 442 Matrix Chain Multiplication(栈)
DescriptionSuppose you have to evaluate an expression like A*B*C*D*E where A,B,C,D and E are matrices. Since matrix multiplication is associative, the order in which multiplications are performed
2015-03-05 13:27:09
425
原创 UVA - 514 Rails(栈)
DescriptionThere is a famous railway station in PopPush City. Country there is incredibly hilly. The station was built in last century. Unfortunately, funds were extremely limited that time. It wa
2015-02-12 22:09:14
348
原创 UVA - 210 Concurrency Simulator
DescriptionPrograms executed concurrently on a uniprocessor system appear to be executed at the same time, but in reality the single CPU alternates between the programs, executing some number of i
2015-02-12 18:42:57
487
原创 POJ - 2533 Longest Ordered Subsequence
DescriptionA numeric sequence of ai is ordered if a1 a2 aN. Let the subsequence of the given numeric sequence ( a1, a2, ..., aN) be any sequence (ai1, ai2, ..., aiK), where 1 i1 i2 iK N. For e
2015-02-08 23:33:20
384
原创 HDU - 2602 Bone Collector(01背包)
Many years ago , in Teddy’s hometown there was a man who was called “Bone Collector”. This man like to collect varies of bones , such as dog’s , cow’s , also he went to the grave … The bone collecto
2015-02-08 23:08:20
420
原创 HDU - 1176 免费馅饼
Description都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉下大把大把的馅饼。说来gameboy的人品实在是太好了,这馅饼别处都不掉,就掉落在他身旁的10米范围内。馅饼如果掉在了地上当然就不能吃了,所以gameboy马上卸下身上的背包去接。但由于小径两侧都不能站人,所以他只能在小径上接。由于gameboy平时老呆在房间里玩游戏,虽然在游戏中是个身手敏捷的高
2015-02-07 22:47:35
343
原创 LightOJ - 1111 Best Picnic Ever
DescriptionK people are having a picnic. They are initially in N cities, conveniently numbered from 1 to N. The roads between cities are connected by M one-way roads (no road connects a city to
2015-02-05 16:52:29
897
原创 LightOJ - 1281 New Traffic System
DescriptionThe country - Ajobdesh has a lot of problems in traffic system. As the Govt. is very clever (!), they made a plan to use only one way roads. Two cities s and t are the two most importan
2015-02-05 15:10:34
1056
原创 LightOJ - 1174 Commandos
DescriptionA group of commandos were assigned a critical task. They are to destroy an enemy head quarter. The enemy head quarter consists of several buildings and the buildings are connected by ro
2015-02-03 23:52:16
821
原创 LightOJ - 1019 Brush (V)
DescriptionTanvir returned home from the contest and got angry after seeing his room dusty. Who likes to see a dusty room after a brain storming programming contest? After checking a bit he found
2015-02-02 15:07:42
537
转载 最短路四种算法
题意,赤果果的最短路想当年傻傻地用floyd和dijkstra乱刷过,最近好好理解了一下最短路,今天用四种算法实现了一遍。以后可以当模板用。代码:floyd[cpp] view plaincopyprint?/* * Author: illuz * Blog: http:/
2015-02-02 12:53:00
668
原创 LightOJ - ???? 最短修复路线(最小生成树)
DescriptionThere are several cities in the country, and some of them are connected by bidirectional roads. Unfortunately, some of the roads are damaged and cannot be used right now. Your goal is t
2015-01-29 15:19:48
524
原创 LightOJ - 1040 Donation
DescriptionA local charity is trying to gather donations of Ethernet cable. You realize that you probably have a lot of extra cable in your house, and make the decision that you will donate as muc
2015-01-29 10:24:16
789
原创 HDU - 1240 Asteroids!
DescriptionYou're in space. You want to get home. There are asteroids. You don't want to hit them. InputInput to this problem will consist of a (non-empty) series of up to
2015-01-28 13:45:46
357
原创 HDU - 1495 非常可乐(倒水问题BFS)
Description大家一定觉的运动以后喝可乐是一件很惬意的事情,但是seeyou却不这么认为。因为每次当seeyou买了可乐以后,阿牛就要求和seeyou一起分享这一瓶可乐,而且一定要喝的和seeyou一样多。但seeyou的手中只有两个杯子,它们的容量分别是N 毫升和M 毫升 可乐的体积为S (S Input三个整数 : S 可乐的体积 , N 和 M
2015-01-26 22:16:51
461
原创 LightOJ - 1046 Rider
DescriptionA rider is a fantasy chess piece that can jump like a knight several times in a single move. A rider that can perform a maximum of K jumps during a single move is denoted as a K-rider.
2015-01-26 12:00:35
1134
原创 UVA-11624 Fire!
DescriptionJane is one of the most talented young programmers as well as an astrophysicist. Recently she discovered a planet and named it Jotunheim - the world of giants. As you already guessed th
2015-01-24 18:52:21
643
原创 HDU-1016 Prime Ring Problem
DescriptionA ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of numbers in two adjacent circles should be a prime. No
2015-01-18 10:25:46
391
原创 LightOJ - 1049 One Way Roads
DescriptionNowadays the one-way traffic is introduced all over the world in order to improve driving safety and reduce traffic jams. The government of Dhaka Division decided to keep up with new tr
2015-01-15 20:45:05
1063
原创 HDU - 1010 Tempter of the Bone
DescriptionThe doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, and the doggie could feel the ground sinking. He realized
2015-01-15 20:34:50
369
原创 LightOJ - 1088 Points in Segments
DescriptionGiven n points (1 dimensional) and q segments, you have to find the number of points that lie in each of the segments. A point pi will lie in a segmentA B if A ≤ pi ≤ B.For example
2015-01-14 15:32:07
985
原创 HDU - 2141 Can you find it?
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+Ck = X.
2015-01-14 15:20:39
402
原创 HDU - 1002 A + B Problem II
DescriptionI have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B. InputThe first line of the input contains an integer T(1<
2015-01-10 23:01:14
409
原创 POJ - 1007
DescriptionOne measure of ``unsortedness'' in a sequence is the number of pairs of entries that are out of order with respect to each other. For instance, in the letter sequence ``DAABEC'', this
2015-01-10 22:52:14
388
原创 HDU - 2393 Higher Math
DescriptionYou are building a house. You'd prefer if all the walls have a precise right angle relative to the ground, but you have no device to measure angles. A friend says he has a great idea ho
2015-01-10 22:46:03
417
原创 LightOJ - 1001 Opposite Task
DescriptionThis problem gives you a flavor the concept of special judge. That means the judge is smart enough to verify your code even though it may print different results. In this problem you ar
2015-01-10 22:37:22
864
原创 UVA - 1588 Kickdown
A research laboratory of a world-leading automobile company has received an order to create a special transmission mechanism, which allows for incredibly efficient kickdown -- an operation of switchin
2015-01-09 18:11:43
726
原创 UVA - 1368 DNA Consensus String
Figure 1.DNA (Deoxyribonucleic Acid) is the molecule which contains the genetic instructions. It consists of four different nucleotides, namely Adenine, Thymine, Guanine, and Cytosine as shown in
2015-01-09 15:04:58
352
原创 UVA - 1587 Box
Ivan works at a factory that produces heavy machinery. He has a simple job -- he knocks up wooden boxes of different sizes to pack machinery for delivery to the customers. Each box is a rectangular
2015-01-09 12:45:04
496
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人