- 博客(47)
- 收藏
- 关注
转载 Day4 - L - Tram POJ - 1847
Tram network in Zagreb consists of a number of intersections and rails connecting some of them. In every intersection there is a switch pointing to the one of the rails going out of the intersect...
2019-08-02 11:55:00
118
转载 Day4 - K - Ant Trip HDU - 3018
Ant Country consist of N towns.There are M roads connecting the towns.Ant Tony,together with his friends,wants to go through every part of the country.They intend to visit every road , and ever...
2019-08-02 09:27:00
111
转载 Day4 - D - Watchcow POJ - 2230
Bessie's been appointed the new watch-cow for the farm. Every night, it's her job to walk across the farm and make sure that no evildoers are doing any evil. She begins at the barn, makes her pat...
2019-08-01 22:04:00
101
转载 Day4 - G - 确定比赛名次 HDU - 1285
有N个比赛队(1<=N<=500),编号依次为1,2,3,。。。。,N进行比赛,比赛结束后,裁判委员会要将所有参赛队伍从前往后依次排名,但现在裁判委员会不能直接获得每个队的比赛成绩,只知道每场比赛的结果,即P1赢P2,用P1,P2表示,排名时P1在P2之前。现在请你编程序确定排名。Input输入有若干组,每组中的第一行为二个数N(1<=N<=500),M;其...
2019-08-01 15:42:00
96
转载 Day4-F-产生冠军 HDU - 2094
有一群人,打乒乓球比赛,两两捉对撕杀,每两个人之间最多打一场比赛。球赛的规则如下:如果A打败了B,B又打败了C,而A与C之间没有进行过比赛,那么就认定,A一定能打败C。如果A打败了B,B又打败了C,而且,C又打败了A,那么A、B、C三者都不可能成为冠军。根据这个规则,无需循环较量,或许就能确定冠军。你的任务就是面对一群比赛选手,在经过了若干场撕杀之后,确定是否已经实际上产生了冠军...
2019-08-01 14:53:00
94
转载 Day4 - C - 六度分离 HDU - 1869
1967年,美国著名的社会学家斯坦利·米尔格兰姆提出了一个名为“小世界现象(small world phenomenon)”的著名假说,大意是说,任何2个素不相识的人中间最多只隔着6个人,即只用6个人就可以将他们联系在一起,因此他的理论也被称为“六度分离”理论(six degrees of separation)。虽然米尔格兰姆的理论屡屡应验,一直也有很多社会学家对其兴趣浓厚,但是在30...
2019-08-01 13:46:00
123
转载 Day4-B-最短路径问题 HDU3790
给你n个点,m条无向边,每条边都有长度d和花费p,给你起点s终点t,要求输出起点到终点的最短距离及其花费,如果最短距离有多条路线,则输出花费最少的。Input输入n,m,点的编号是1~n,然后是m行,每行4个数 a,b,d,p,表示a和b之间有一条边,且其长度为d,花费为p。最后一行是两个数 s,t;起点s,终点。n和m为0时输入结束。(1<n<=1000, 0<...
2019-08-01 13:35:00
418
转载 Day4-A-最短路 HDU2544
在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt。但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的!所以现在他们想要寻找最短的从商店到赛场的路线,你可以帮助他们吗?Input输入包括多组数据。每组数据第一行是两个整数N、M(N<=100,M<=10000),N表示成都的大街上有几个路口,标号为1的路口是商店所在地,标号为N...
2019-08-01 13:03:00
69
转载 Day3-B-Round Marriage CodeForces-981F
It's marriage season in Ringland!Ringland has a form of a circle's boundary of lengthLL. There arennbridegrooms andnnbrides, and bridegrooms decided to marry brides.Of course, each bride...
2019-07-31 20:25:00
107
转载 Day3-A-Problem H. Monster Hunter HDU6326
Little Q is fighting against scary monsters in the game ``Monster Hunter''. The battlefield consists ofnnintersections, labeled by1,2,...,n1,2,...,n, connected byn−1n−1bidirectional roads. Li...
2019-07-29 11:50:00
222
转载 Day3-G - Task HDU4864
Today the company has m tasks to complete. The ith task need xi minutes to complete. Meanwhile, this task has a difficulty level yi. The machine whose level below this task’s level yi cannot comp...
2019-07-27 22:20:00
84
转载 Day3-I-Squares POJ2002
A square is a 4-sided polygon whose sides have equal length and adjacent sides form 90-degree angles. It is also a polygon such that rotating about its centre by 90 degrees gives the same poly...
2019-07-27 21:45:00
77
转载 Day3-M-Cable master POJ1064
Inhabitants of the Wonderland have decided to hold a regional programming contest. The Judging Committee has volunteered and has promised to organize the most honest contest ever. It was decided ...
2019-07-26 23:03:00
70
转载 Day3-N - Monthly Expense POJ3273
Farmer John is an astounding accounting wizard and has realized he might run out of money to run the farm. He has already calculated and recorded the exact amount of money (1 ≤moneyi≤ 10,000)...
2019-07-26 21:29:00
67
转载 Day3-O-Median POJ3579
GivenNnumbers,X1,X2, ... ,XN, let us calculate the difference of every pair of numbers: ∣Xi-Xj∣ (1 ≤i<j≤N). We can getC(N,2)differences through this work, and now your task is to ...
2019-07-26 20:36:00
84
转载 Day3-P - Matrix POJ3685
Given aN×Nmatrix A, whose element in thei-th row andj-th columnAijis an number that equalsi2+ 100000 ×i+j2- 100000 ×j+i×j, you are to find theM-th smallest element in the ma...
2019-07-26 17:33:00
80
转载 Day3-L-Cup HDU2289
The WHU ACM Team has a big cup, with which every member drinks water. Now, we know the volume of the water in the cup, can you tell us it height?The radius of the cup's top and bottom circle is ...
2019-07-26 15:06:00
75
转载 Day3-Q-修补木桶 HihoCoder1362
一只木桶能盛多少水,并不取决于桶壁上最高的那块木板,而恰恰取决于桶壁上最短的那块。已知一个木桶的桶壁由N块木板组成,第i块木板的长度为Ai。现在小Hi有一个快捷修补工具,每次可以使用修补工具将连续的不超过L块木板提高至任意高度。已知修补工具一共可以使用M次(M*L<N),如何修补才能使最短的那块木板最高呢?注意: 木板是环形排列的,第N-1块、第N块和第1块也被视为...
2019-07-26 14:20:00
79
转载 Day3-R-Aggressive cows POJ2456
Farmer John has built a new long barn, with N (2 <= N <= 100,000) stalls. The stalls are located along a straight line at positions x1,...,xN (0 <= xi <= 1,000,000,000).His C (2 <=...
2019-07-26 12:42:00
91
转载 Day3-K-Can you solve this equation? HDU2199
Now,given the equation 8*x^4 + 7*x^3 + 2*x^2 + 3*x + 6 == Y,can you find its solution between 0 and 100;Now please try your lucky.InputThe first line of the input contains an integer T(1<...
2019-07-25 15:03:00
72
转载 Day3-J-4 Values whose Sum is 0 POJ2785
The SUM problem can be formulated as follows: given four lists A, B, C, D of integer values, compute how many quadruplet (a, b, c, d ) ∈ A x B x C x D are such that a + b + c + d = 0 . In the fol...
2019-07-25 15:01:00
79
转载 Day3-H-Alice and Bob HDU4268
Alice and Bob's game never ends. Today, they introduce a new game. In this game, both of them have N different rectangular cards respectively. Alice wants to use his cards to cover Bob's. The car...
2019-07-24 23:27:00
104
转载 Day3-F-Buy Low Sell High-CodeForces867E
You can perfectly predict the price of a certain stock for the nextNdays. You would like to profit on this knowledge, but only want to transact one share of stock per day. That is, each day you...
2019-07-24 20:56:00
139
转载 Day3-E-New Year Snowmen CodeForces140C
As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey...
2019-07-24 17:54:00
86
转载 Day3-D-Protecting the Flowers POJ3262
Farmer John went to cut some wood and leftN(2 ≤N≤ 100,000) cows eating the grass, as usual. When he returned, he found to his horror that the cluster of cows was in his garden eating his be...
2019-07-24 16:53:00
100
转载 Day3-C-Radar Installation POJ1328
Assume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island is a point locating in the sea side. And any radar installation, locating on...
2019-07-24 16:24:00
100
转载 Day2-O-Coloring a Tree CodeForces-902B
You are given a rooted tree withnvertices. The vertices are numbered from1ton, the root is the vertex number1.Each vertex has a color, let's denote the color of vertexvbycv. Initially...
2019-07-24 15:16:00
166
转载 Day2-N-滑雪-POJ1088
Michael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道载一个区域中最长底滑坡。区域由一个二维数组给出。数组的每个数字代表点的高度。下面是一个例子 1 2 3 4 516 17 18 19 615 24 25 20 714 23 22 21 8...
2019-07-23 15:28:00
62
转载 Day2-M-Prime Ring Problem-HDU1016
A 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.Note: the number...
2019-07-23 13:37:00
59
转载 Day2-L-棋盘问题-POJ1321
在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输入含有多组测试数据。每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及摆放棋子的数目。 n <= 8 , k <...
2019-07-23 11:30:00
139
转载 Day2-K-Red and Black-HDU1312
There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of four adjacent tiles. But he...
2019-07-23 10:37:00
44
转载 Day2-J-逃离迷宫-HDU-1728
给定一个m × n (m行, n列)的迷宫,迷宫中有两个位置,gloria想从迷宫的一个位置走到另外一个位置,当然迷宫中有些地方是空地,gloria可以穿越,有些地方是障碍,她必须绕行,从迷宫的一个位置,只能走到与它相邻的4个位置中,当然在行走过程中,gloria不能走到迷宫外面去。令人头痛的是,gloria是个没什么方向感的人,因此,她在行走过程中,不能转太多弯了,否则她会晕倒的。我们...
2019-07-23 10:18:00
269
转载 Day2-I-Knight's Problem POJ - 3985
You must have heard of the Knight's Tour problem. In that problem, a knight is placed on an empty chess board and you are to determine whether it can visit each square on the board exactly once....
2019-07-22 21:05:00
349
转载 Day2-H-非常可乐-HDU1495
大家一定觉的运动以后喝可乐是一件很惬意的事情,但是seeyou却不这么认为。因为每次当seeyou买了可乐以后,阿牛就要求和seeyou一起分享这一瓶可乐,而且一定要喝的和seeyou一样多。但seeyou的手中只有两个杯子,它们的容量分别是N 毫升和M 毫升 可乐的体积为S (S<101)毫升 (正好装满一瓶) ,它们三个之间可以相互倒可乐 (都是没有刻度的,且 S==N+M,1...
2019-07-21 22:00:00
56
转载 Day2-G-Sticks-POJ1011
George took sticks of the same length and cut them randomly until all parts became at most 50 units long. Now he wants to return sticks to the original state, but he forgot how many sticks he had...
2019-07-21 21:21:00
94
转载 Day2-F-A Knight's Journey POJ-2488
BackgroundThe knight is getting bored of seeing the same black and white squares again and again and has decided to make a journeyaround the world. Whenever a knight moves, it is two squares in...
2019-07-21 15:32:00
86
转载 Day2-E-Catch That Cow-POJ3278
Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a pointN(0 ≤N≤ 100,000) on a number line and the cow is at a pointK(0 ≤K...
2019-07-21 14:00:00
65
转载 Day2-D-Oil Deposits-POJ-1562
The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid that divid...
2019-07-21 13:22:00
102
转载 Day2-C-迷宫问题 -POJ3984
定义一个二维数组: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表示可以走的路,只能横着走或竖着走,不能斜着走,要求编程序找出从左上角到右下角的最短路线。Input...
2019-07-21 12:21:00
959
转载 Day1-Luogu-2085
题目描述有n个函数,分别为F1,F2,...,Fn。定义Fi(x)=Ai*x^2+Bi*x+Ci (x∈N*)。给定这些Ai、Bi和Ci,请求出所有函数的所有函数值中最小的m个(如有重复的要输出多个)。输入输出格式输入格式:输入数据:第一行输入两个正整数n和m。以下n行每行三个正整数,其中第i行的三个数分别位Ai、Bi和Ci。Ai<=10,Bi<=100...
2019-07-20 09:15:00
88
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人