
图论
文章平均质量分 80
tokers
所有的魅力在“习惯”面前都将无色。
展开
-
LightOJ1012---Guilty Prince (并查集)
Once there was a king named Akbar. He had a son named Shahjahan. For an unforgivable reason the king wanted him to leave the kingdom. Since he loved his son he decided his son would be banished in a ne原创 2015-06-07 18:09:02 · 1057 阅读 · 0 评论 -
POJ1847---Tram
TramTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 10622 Accepted: 3877DescriptionTram network in Zagreb consists of a number of intersections and rails原创 2015-02-05 14:46:27 · 899 阅读 · 0 评论 -
POJ1062---昂贵的聘礼
Description 年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探险家拿不出这么多金币,便请求酋长降低要求。酋长说:”嗯,如果你能够替我弄到大祭司的皮袄,我可以只要8000金币。如果你能够弄来他的水晶球,那么只要5000金币就行了。”探险家就跑到大祭司那里,向他要求皮袄或水晶球,大祭司要他用金币来换,原创 2015-02-05 19:21:18 · 844 阅读 · 0 评论 -
Timus Online Judge1627--- Join
1627. JoinTime limit: 4.0 secondMemory limit: 64 MBBusinessman Petya recently bought a new house. This house has one floor withn × m square rooms, placed in rectangular lattice. Some roo原创 2015-01-29 18:51:04 · 1323 阅读 · 0 评论 -
POJ1860---Currency Exchange
Currency ExchangeTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 21122 Accepted: 7572DescriptionSeveral currency exchange points are working in our city.原创 2015-01-30 19:19:33 · 777 阅读 · 0 评论 -
SGU 101. Domino
101. Dominotime limit per test: 0.25 sec. memory limit per test: 4096 KBDominoes – game played with small, rectangular blocks of wood or other material, each identified by a number of dots,原创 2015-01-29 15:57:27 · 930 阅读 · 0 评论 -
Codeforces Round #288 (Div. 2)---D. Tanya and Password
D. Tanya and Passwordtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputWhile dad was at work, a little girl Tanya deci原创 2015-01-29 12:39:54 · 1371 阅读 · 0 评论 -
POJ2337---Catenyms
CatenymsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 9887 Accepted: 2583DescriptionA catenym is a pair of words separated by a period such that the las原创 2015-01-29 13:56:30 · 716 阅读 · 0 评论 -
hdu1546——Idiomatic Phrases Game
Idiomatic Phrases GameTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2191 Accepted Submission(s): 712Problem DescriptionTom is p原创 2014-12-03 19:03:23 · 857 阅读 · 0 评论 -
hdu4009---Transfer water
Transfer waterTime Limit: 5000/3000 MS (Java/Others) Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 3964 Accepted Submission(s): 1424Problem DescriptionXiaoA lives in原创 2015-01-26 16:21:47 · 981 阅读 · 0 评论 -
SPOJ104. Highways
104. HighwaysProblem code: HIGHIn some countries building highways takes a lot of time... Maybe that's because there are many possiblities to construct a network of highways and engineers can't原创 2015-01-27 13:54:26 · 1311 阅读 · 0 评论 -
hdu2121---Ice_cream’s world II
Ice_cream’s world IITime Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3045 Accepted Submission(s): 718Problem DescriptionAfter awar原创 2015-01-26 15:28:43 · 900 阅读 · 0 评论 -
hdu4305---Lightning
LightningTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1565 Accepted Submission(s): 515Problem DescriptionThere are N robots st原创 2015-01-26 22:24:50 · 706 阅读 · 0 评论 -
hdu3339——In Action
In ActionTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4256 Accepted Submission(s): 1372Problem DescriptionSince 1945, when t原创 2014-11-28 15:38:32 · 806 阅读 · 0 评论 -
POJ3694----Network
NetworkTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 6989 Accepted: 2497DescriptionA network administrator manages a large network. The network cons原创 2015-01-17 14:55:23 · 733 阅读 · 0 评论 -
hdu1045---Fire Net
Problem Description Suppose that we have a square city with straight streets. A map of a city is a square board with n rows and n columns, each representing a street or a piece of wall.A blockhouse is原创 2015-02-16 12:47:19 · 796 阅读 · 0 评论 -
hdu1281---棋盘游戏
Problem Description 小希和Gardon在玩一个游戏:对一个N*M的棋盘,在格子里放尽量多的一些国际象棋里面的“车”,并且使得他们不能互相攻击,这当然很简单,但是Gardon限制了只有某些格子才可以放,小希还是很轻松的解决了这个问题(见下图)注意不能放车的地方不影响车的互相攻击。 所以现在Gardon想让小希来解决一个更难的问题,在保证尽量多的“车”的前提下,棋盘里有些格子是可原创 2015-02-16 19:01:25 · 1063 阅读 · 0 评论 -
LightOJ1009---Back to Underworld (bfs染色)
The Vampires and Lykans are fighting each other to death. The war has become so fierce that, none knows who will win. The humans want to know who will survive finally. But humans are afraid of going to原创 2015-06-05 13:00:35 · 1343 阅读 · 0 评论 -
LightOJ1003---Drunk(拓扑排序判环)
One of my friends is always drunk. So, sometimes I get a bit confused whether he is drunk or not. So, one day I was talking to him, about his drinks! He began to describe his way of drinking. So, let m原创 2015-06-03 10:38:57 · 1402 阅读 · 0 评论 -
LightOJ1002---Country Roads (最短路变形)
I am going to my home. There are many cities and many bi-directional roads between them. The cities are numbered from 0 to n-1 and each road has a cost. There are m roads. You are given the number of m原创 2015-06-02 20:27:40 · 1158 阅读 · 0 评论 -
Codeforces Round #303 (Div. 2)
A.简单题/************************************************************************* > File Name: A.cpp > Author: ALex > Mail: zchao1995@gmail.com > Created Time: 2015年05月20日 星期三 09时51分15秒原创 2015-05-21 14:45:33 · 753 阅读 · 0 评论 -
Codeforces Round #179 (Div. 2)---D. Greg and Graph(离线+floyd)
Greg has a weighed directed graph, consisting of n vertices. In this graph any pair of distinct vertices has an edge between them in both directions. Greg loves playing with the graph and now he has in原创 2015-04-27 14:13:34 · 992 阅读 · 0 评论 -
Codeforces Round #216 (Div. 2)---C. Valera and Elections
The city Valera lives in is going to hold elections to the city Parliament.The city has n districts and n - 1 bidirectional roads. We know that from any district there is a path along the roads to any原创 2015-04-07 12:11:17 · 936 阅读 · 0 评论 -
Codeforces Round #103 (Div. 2)---D. Missile Silos(最短路+枚举边)
A country called Berland consists of n cities, numbered with integer numbers from 1 to n. Some of them are connected by bidirectional roads. Each road has some length. There is a path from each city to原创 2015-03-25 19:04:23 · 803 阅读 · 0 评论 -
Codeforces Round #294 (Div. 2)---E. A and B and Lecture Rooms
A and B are preparing themselves for programming contests.The University where A and B study is a set of rooms connected by corridors. Overall, the University has n rooms connected by n - 1 corridors s原创 2015-02-28 23:43:14 · 1179 阅读 · 0 评论 -
POJ3164---Command Network
Command NetworkTime Limit: 1000MS Memory Limit: 131072KTotal Submissions: 13609 Accepted: 3925DescriptionAfter a long lasting war on words, a war on arms finally原创 2015-01-26 14:42:49 · 732 阅读 · 0 评论 -
hdu4081---Qin Shi Huang's National Road System
Qin Shi Huang's National Road SystemTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4043 Accepted Submission(s): 1393Problem Descri原创 2015-01-25 20:15:26 · 1004 阅读 · 0 评论 -
[kuangbin带你飞]专题九 连通图 题解报告
专题链接关于tarjanA - Network of Schools 原题地址本题有2个问题,第一个是要算最少要给多少个点软件,才能使所有点都可以收到副本第二个是要算最少加多少条边,使得图变成强连通1:tarjan求强连通,然后缩点,计算入度为0的强连通分量2:设现在有a个入度为0的点,b个出度为0的点(缩完点后的点),最合理的加边方法肯定是从出度为0的点原创 2015-01-22 17:05:58 · 4271 阅读 · 0 评论 -
hdu2807---The Shortest Path
The Shortest PathTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2552 Accepted Submission(s): 807Problem DescriptionThere are N c原创 2015-01-03 12:32:07 · 716 阅读 · 0 评论 -
hdu4685---Prince and Princess
Prince and PrincessTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 1165 Accepted Submission(s): 325Problem DescriptionThere are n原创 2015-01-21 16:52:50 · 937 阅读 · 0 评论 -
POJ1125——Stockbroker Grapevine
Stockbroker GrapevineTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 27547 Accepted: 15264DescriptionStockbrokers are known to overreact to rumours. You h原创 2014-11-05 21:34:09 · 775 阅读 · 0 评论 -
hdu1179——Ollivanders: Makers of Fine Wands since 382 BC.
Ollivanders: Makers of Fine Wands since 382 BC.Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 964 Accepted Submission(s): 539Prob原创 2014-10-31 14:41:23 · 1345 阅读 · 0 评论 -
POJ2375——Cow Ski Area
Cow Ski AreaTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 2376 Accepted: 668DescriptionFarmer John's cousin, Farmer Ron, who lives in the mountains of C原创 2014-10-03 20:34:41 · 726 阅读 · 0 评论 -
hdu3072——Intelligence System
Intelligence SystemTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1484 Accepted Submission(s): 655Problem DescriptionAfter a day原创 2014-10-03 12:39:45 · 688 阅读 · 0 评论 -
POJ2553——The Bottom of a Graph
The Bottom of a GraphTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 8902 Accepted: 3688DescriptionWe will use the following (standard) definitions from g原创 2014-10-03 17:33:28 · 729 阅读 · 0 评论 -
hdu2647——Reward
RewardTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4306 Accepted Submission(s): 1318Problem DescriptionDandelion's uncle is a原创 2014-10-29 16:24:05 · 707 阅读 · 0 评论 -
POJ2983——Is the Information Reliable?
Is the Information Reliable?Time Limit: 3000MS Memory Limit: 131072KTotal Submissions: 11334 Accepted: 3575DescriptionThe galaxy war between the Empire Draco and原创 2014-10-29 18:53:59 · 788 阅读 · 0 评论 -
POJ3169——Layout && hdu3592——World Exhibition
这两题完全一个意思,都是差分约束的水题原创 2014-10-29 18:26:50 · 762 阅读 · 0 评论 -
hdu1827——Summer Holiday
Summer HolidayTime Limit: 10000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1727 Accepted Submission(s): 800Problem DescriptionTo see a World原创 2014-10-02 20:57:16 · 722 阅读 · 0 评论 -
hdu2767——Proving Equivalences
Proving EquivalencesTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3226 Accepted Submission(s): 1216Problem DescriptionConsider原创 2014-10-02 20:00:28 · 734 阅读 · 0 评论