- 博客(27)
- 收藏
- 关注
原创 hdoj 1232 畅通工程
Problem Description 某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路? Input 测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别是城镇数目N ( < 1000 )和道路数目M;随
2017-06-01 23:34:38
215
转载 并查集详解 (转)
这个文章是几年前水acm的时候转的, 当时也不知道作者是谁, 要是有人知道的话说一下吧并查集是我暑假从高手那里学到的一招,觉得真是太精妙的设计了。以前我无法解决的一类问题竟然可以用如此简单高效的方法搞定。不分享出来真是对不起party了。(party:我靠,关我嘛事啊?我跟你很熟么?) 来看一个实例,杭电1232畅通工程 首先在地图上给你若干个城镇,这些城镇都可以看作点,然后告诉你哪些对城镇之间
2017-06-01 23:31:55
277
原创 poj1323 Game Prediction
Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 10475 Accepted: 5046DescriptionSuppose there are M people, including you, playing a special card game. At the begin
2017-06-01 23:25:35
293
原创 poj 1323 Game Prediction
题目 Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 10475 Accepted: 5046DescriptionSuppose there are M people, including you, playing a special card game. At the b
2017-05-19 15:19:47
205
原创 poj 1042 Gone Fishing
题目 借鉴 Time Limit: 2000MS Memory Limit: 32768K Total Submissions: 35019 Accepted: 10882 DescriptionJohn is going on a fishing trip. He has h hours available (1 <= h <= 16), and there are
2017-05-18 00:28:08
188
原创 poj 2586 Y2K Accounting Bug Time Limit
题目 Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 15170 Accepted: 7595 DescriptionAccounting for Computer Machinists (ACM) has sufferred from the Y2K bug and lost some vital
2017-05-17 23:24:34
189
原创 poj 2109 Power of Cryptography
题目 Power of Cryptography Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 25133 Accepted: 12603Description Current work in cryptography involves (among other things) large pri
2017-05-12 08:32:38
176
原创 poj 3262 Protecting the Flowers
题目链接 Protecting the Flowers Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 7154 Accepted: 2889 DescriptionFarmer John went to cut some wood and left N (2 ≤ N ≤ 100,000) cows ea
2017-05-11 23:28:17
188
原创 poj 1862 Stripies
题目 Stripies Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 16869 Accepted: 7639Description Our chemical biologists have invented a new very useful form of life called stripi
2017-05-11 18:03:17
191
原创 poj 3040 Allowance
题目 Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 3643 Accepted: 1464 DescriptionAs a reward for record milk production, Farmer John has decided to start paying Bessie the cow a
2017-05-11 00:03:39
197
原创 poj 2393 Yogurt factory
题目链接 Yogurt factory Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 10470 Accepted: 5307 DescriptionThe cows have purchased a yogurt factory that makes world-famous Yucky Yog
2017-05-10 00:20:25
312
原创 poj 3190 Stall Reservations
题目链接Stall Reservations Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 6689 Accepted: 2415 Special Judge DescriptionOh those picky N (1 <= N <= 50,000) cows! They are so pic
2017-05-09 23:53:25
206
原创 poj 3190 Stall Reservations
题目地址Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 6680 Accepted: 2412 Special Judge DescriptionOh those picky N (1 <= N <= 50,000) cows! They are so picky that each one will only be m
2017-05-05 16:24:03
224
原创 poj 1328 Radar Installation
Radar Installation 题目地址Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 86095 Accepted: 19253 DescriptionAssume the coasting is an infinite straight line. Land is in one side of coasting
2017-05-05 16:21:09
231
原创 poj 2376 Cleaning Shifts
Cleaning Shifts Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 20919 Accepted: 5277 DescriptionFarmer John is assigning some of his N (1 <= N <= 25,000) cows to do some clean
2017-05-04 00:39:35
168
原创 poj 1017 Packets
Packets Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 54722 Accepted: 18607 DescriptionA factory produces products packed in square packets of the same height h and of the s
2017-05-04 00:02:51
171
原创 poj 3253 Fence Repair
Fence Repair Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 47277 Accepted: 15468 DescriptionFarmer John wants to repair a small length of the fence around the pasture. He me
2017-05-01 22:21:49
177
原创 poj 3069 Saruman's Army
题目链接 Saruman’s Army Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 9945 Accepted: 5006 DescriptionSaruman the White must lead his army along a straight path from Isengard to He
2017-05-01 16:56:44
193
原创 poj 3617 Best Cow Line
题目地址 Best Cow Line Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 23680 Accepted: 6435 DescriptionFJ is about to take his N (1 ≤ N ≤ 2,000) cows to the annual”Farmer of the
2017-05-01 16:35:48
191
原创 POJ 2386 Lake Counting
Lake Counting Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 17917 Accepted: 9069 Description Due to recent rains, water has pooled in various places in Farmer John’s field,
2017-04-24 23:42:24
189
原创 leetcode 70. Climbing Stairs
You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?Note: Given n will be a positive inte
2017-04-24 23:27:08
177
原创 迷宫的最短路径 bfs
给定一个大小为N*M的迷宫,由通道(‘.’)和墙壁(‘#’)组成,其中通道S表示起点,通道G表示终点,每一步移动可以达到上下左右中不是墙壁的位置。试求出起点到终点的最小步数。(本题假定迷宫是有解的)(N,M<=100)样例输入:
2017-04-20 00:31:51
491
原创 uva 572
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 divides t
2017-04-19 23:42:50
190
转载 kmp算法理解解释(1)
字符串匹配是计算机的基本任务之一。 举例来说,有一个字符串"BBC ABCDAB ABCDABCDABDE",我想知道,里面是否包含另一个字符串"ABCDABD"? 许多算法可以完成这个任务,Knuth-Morris-Pratt算法(简称KMP)是最常用的之一。它以三个发明者命名,起头的那个K就是著名科学家Donald Knuth。 这种算法不太容
2017-03-22 00:04:40
233
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人