图论
文章平均质量分 80
tokers
所有的魅力在“习惯”面前都将无色。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
hdu1281---棋盘游戏
Problem Description 小希和Gardon在玩一个游戏:对一个N*M的棋盘,在格子里放尽量多的一些国际象棋里面的“车”,并且使得他们不能互相攻击,这当然很简单,但是Gardon限制了只有某些格子才可以放,小希还是很轻松的解决了这个问题(见下图)注意不能放车的地方不影响车的互相攻击。 所以现在Gardon想让小希来解决一个更难的问题,在保证尽量多的“车”的前提下,棋盘里有些格子是可原创 2015-02-16 19:01:25 · 1129 阅读 · 0 评论 -
hdu3339——In Action
In Action Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 4256 Accepted Submission(s): 1372 Problem Description Since 1945, when t原创 2014-11-28 15:38:32 · 867 阅读 · 0 评论 -
hdu4305---Lightning
Lightning Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1565 Accepted Submission(s): 515 Problem Description There are N robots st原创 2015-01-26 22:24:50 · 781 阅读 · 0 评论 -
hdu2121---Ice_cream’s world II
Ice_cream’s world II Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3045 Accepted Submission(s): 718 Problem Description After awar原创 2015-01-26 15:28:43 · 960 阅读 · 0 评论 -
SPOJ104. Highways
104. Highways Problem code: HIGH In 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 · 1382 阅读 · 0 评论 -
hdu4009---Transfer water
Transfer water Time Limit: 5000/3000 MS (Java/Others) Memory Limit: 65768/65768 K (Java/Others) Total Submission(s): 3964 Accepted Submission(s): 1424 Problem Description XiaoA lives in原创 2015-01-26 16:21:47 · 1050 阅读 · 0 评论 -
hdu1546——Idiomatic Phrases Game
Idiomatic Phrases Game Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 2191 Accepted Submission(s): 712 Problem Description Tom is p原创 2014-12-03 19:03:23 · 912 阅读 · 0 评论 -
POJ2337---Catenyms
Catenyms Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 9887 Accepted: 2583 Description A catenym is a pair of words separated by a period such that the las原创 2015-01-29 13:56:30 · 780 阅读 · 0 评论 -
Codeforces Round #288 (Div. 2)---D. Tanya and Password
D. Tanya and Password time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output While dad was at work, a little girl Tanya deci原创 2015-01-29 12:39:54 · 1422 阅读 · 0 评论 -
SGU 101. Domino
101. Domino time limit per test: 0.25 sec. memory limit per test: 4096 KB Dominoes – game played with small, rectangular blocks of wood or other material, each identified by a number of dots,原创 2015-01-29 15:57:27 · 988 阅读 · 0 评论 -
POJ1860---Currency Exchange
Currency Exchange Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 21122 Accepted: 7572 Description Several currency exchange points are working in our city.原创 2015-01-30 19:19:33 · 831 阅读 · 0 评论 -
Timus Online Judge1627--- Join
1627. Join Time limit: 4.0 second Memory limit: 64 MB Businessman Petya recently bought a new house. This house has one floor with n × m square rooms, placed in rectangular lattice. Some roo原创 2015-01-29 18:51:04 · 1411 阅读 · 0 评论 -
POJ1062---昂贵的聘礼
Description 年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探险家拿不出这么多金币,便请求酋长降低要求。酋长说:”嗯,如果你能够替我弄到大祭司的皮袄,我可以只要8000金币。如果你能够弄来他的水晶球,那么只要5000金币就行了。”探险家就跑到大祭司那里,向他要求皮袄或水晶球,大祭司要他用金币来换,原创 2015-02-05 19:21:18 · 889 阅读 · 0 评论 -
POJ1847---Tram
Tram Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 10622 Accepted: 3877 Description Tram network in Zagreb consists of a number of intersections and rails原创 2015-02-05 14:46:27 · 1044 阅读 · 0 评论 -
POJ3694----Network
Network Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 6989 Accepted: 2497 Description A network administrator manages a large network. The network cons原创 2015-01-17 14:55:23 · 787 阅读 · 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 · 836 阅读 · 0 评论 -
POJ1125——Stockbroker Grapevine
Stockbroker Grapevine Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 27547 Accepted: 15264 Description Stockbrokers are known to overreact to rumours. You h原创 2014-11-05 21:34:09 · 837 阅读 · 0 评论 -
hdu4685---Prince and Princess
Prince and Princess Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others) Total Submission(s): 1165 Accepted Submission(s): 325 Problem Description There are n原创 2015-01-21 16:52:50 · 1007 阅读 · 0 评论 -
hdu2807---The Shortest Path
The Shortest Path Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2552 Accepted Submission(s): 807 Problem Description There are N c原创 2015-01-03 12:32:07 · 768 阅读 · 0 评论 -
[kuangbin带你飞]专题九 连通图 题解报告
专题链接 关于tarjan A - Network of Schools 原题地址 本题有2个问题,第一个是要算最少要给多少个点软件,才能使所有点都可以收到副本 第二个是要算最少加多少条边,使得图变成强连通 1:tarjan求强连通,然后缩点,计算入度为0的强连通分量 2:设现在有a个入度为0的点,b个出度为0的点(缩完点后的点),最合理的加边方法肯定是从出度为0的点原创 2015-01-22 17:05:58 · 4394 阅读 · 0 评论 -
hdu4081---Qin Shi Huang's National Road System
Qin Shi Huang's National Road System Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 4043 Accepted Submission(s): 1393 Problem Descri原创 2015-01-25 20:15:26 · 1092 阅读 · 0 评论 -
POJ3164---Command Network
Command Network Time Limit: 1000MS Memory Limit: 131072K Total Submissions: 13609 Accepted: 3925 Description After a long lasting war on words, a war on arms finally原创 2015-01-26 14:42:49 · 796 阅读 · 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 · 1241 阅读 · 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 · 875 阅读 · 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 · 1004 阅读 · 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 · 1067 阅读 · 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 · 823 阅读 · 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 · 1244 阅读 · 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 · 1490 阅读 · 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 · 1423 阅读 · 0 评论 -
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 · 1141 阅读 · 0 评论 -
hdu1150——Machine Schedule
Machine Schedule Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 5965 Accepted Submission(s): 2999 Problem Description As we all kno原创 2014-10-30 20:36:35 · 1023 阅读 · 0 评论 -
2014年04月16日
DIJKSTRA算法实现单源最短路本人很懒并且很渣,所以写得不合适的地方还请各位大牛指出,注:下面针对的图是无向图,并且采用邻接矩阵的方式存储图 先来说明下什么是最短路,从一个给定的顶点开始,到任意一个顶点的最短路径,就成为源点到该点的最短路径 算法原理: 按路径长度递增次序产生最短路径算法: 把V分成两组: (1)S:已求出最短路径的顶点的集合 (2)V-S=T:尚未确定最短路径的顶点原创 2014-08-05 10:41:27 · 526 阅读 · 0 评论 -
2014年04月27日
据说是最高效的邻接表....别误会,小人只是个渣,这里不自量力下,昨天刚向老蔡学的,给出我的理解 先给出数据结构struct EDGE{ int next; int to; int dist;}mat[3*maxn];int head[maxn]; next 这个.........不好表达,先说下面的to 很显然,给出一条边,to就是边的终点dist 就是这条边的权值好的,原创 2014-08-05 10:41:31 · 681 阅读 · 0 评论 -
hdu2722——Here We Go(relians) Again
Here We Go(relians) Again Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 711 Accepted Submission(s): 347 Problem Description The Go原创 2014-09-18 15:19:54 · 772 阅读 · 0 评论 -
POJ3114——Countries in War
Countries in War Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 2603 Accepted: 776 Description In the year 2050, after different attempts of the UN to mai原创 2014-10-06 15:11:52 · 945 阅读 · 0 评论 -
hdu1596——find the safest road
find the safest road Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 7275 Accepted Submission(s): 2580 Problem Description XX星球有很多城原创 2014-10-26 12:57:10 · 789 阅读 · 0 评论 -
hdu2767——Proving Equivalences
Proving Equivalences Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3226 Accepted Submission(s): 1216 Problem Description Consider原创 2014-10-02 20:00:28 · 775 阅读 · 0 评论 -
hdu1827——Summer Holiday
Summer Holiday Time Limit: 10000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1727 Accepted Submission(s): 800 Problem Description To see a World原创 2014-10-02 20:57:16 · 775 阅读 · 0 评论 -
POJ3169——Layout && hdu3592——World Exhibition
这两题完全一个意思,都是差分约束的水题原创 2014-10-29 18:26:50 · 834 阅读 · 0 评论
分享