上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 29 下一页
摘要: DescriptionIt's raining outside. Farmer Johnson's bull Ben wants some rain to water his flowers. Ben nails two wooden boards on the wall of his barn. Shown in the pictures below, the two boards on the wall just look like two segments on the plane, as they have the same width.Your mission is 阅读全文
posted @ 2013-11-09 17:49 Oyking 阅读(252) 评论(0) 推荐(0) 编辑
摘要: DescriptionWe all know that a pair of distinct points on a plane defines a line and that a pair of lines on a plane will intersect in one of three ways: 1) no intersection because they are parallel, 2) intersect in a line because they are on top of one another (i.e. they are the same line), 3) inter 阅读全文
posted @ 2013-11-08 22:39 Oyking 阅读(239) 评论(0) 推荐(0) 编辑
摘要: DescriptionStan has n sticks of various length. He throws them one at a time on the floor in a random way. After finishing throwing, Stan tries to find the top sticks, that is these sticks such that there is no stick on top of them. Stan has noticed that the last thrown stick is always on top but he 阅读全文
posted @ 2013-11-08 20:45 Oyking 阅读(259) 评论(0) 推荐(0) 编辑
摘要: DescriptionThe most exciting space discovery occurred at the end of the 20th century. In 1999, scientists traced down an ant-like creature in the planet Y1999 and called it M11. It has only one eye on the left side of its head and just three feet all on the right side of its body and suffers from th 阅读全文
posted @ 2013-11-08 17:34 Oyking 阅读(301) 评论(0) 推荐(0) 编辑
摘要: DescriptionA square township has been divided up into n*m(n rows and m columns) square plots (1 2 #include 3 #include 4 #include 5 using namespace std; 6 typedef long long LL; 7 8 const int MAXN = 12; 9 const int SIZEH = 13131; 10 const int MAXH = 20010; 11 12 struct hash_map { 13 i... 阅读全文
posted @ 2013-11-06 18:49 Oyking 阅读(241) 评论(0) 推荐(0) 编辑
摘要: DescriptionGive a tree with n vertices,each edge has a length(positive integer less than 1001).Define dist(u,v)=The min distance between node u and v.Give an integer k,for every pair (u,v) of vertices is called valid if and only if dist(u,v) not exceed k.Write a program that will count how many pair 阅读全文
posted @ 2013-11-05 20:00 Oyking 阅读(206) 评论(0) 推荐(0) 编辑
摘要: DescriptionConsider a tree T with N (1 2 #include 3 #include 4 #include 5 using namespace std; 6 7 const int MAXN = 20010; 8 const int MAXE = 40010; 9 const int INF = 0x7fff7fff;10 11 int head[MAXN], size[MAXN], maxSize[MAXN], f[MAXN];12 int to[MAXE], next[MAXE];13 int n, ecnt;14 15 void init()... 阅读全文
posted @ 2013-11-05 16:49 Oyking 阅读(344) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://poj.org/problem?id=2631DescriptionBuilding and maintaining roads among communities in the far North is an expensive business. With this in... 阅读全文
posted @ 2013-11-05 13:04 Oyking 阅读(764) 评论(0) 推荐(1) 编辑
摘要: Simon loves neatness. So before he goes to bed, Simon wants to complete all chores in the house.Simon's house looks like a rectangular table consisting ofnrows andncolumns from above. All rows of the table are numbered from1tonfrom top to bottom. All columns of the table are numbered from1tonfro 阅读全文
posted @ 2013-11-03 15:55 Oyking 阅读(281) 评论(0) 推荐(0) 编辑
摘要: One day Greg and his friends were walking in the forest. Overall there werenpeople walking, including Greg. Soon he found himself in front of a river. The guys immediately decided to get across the river. Luckily, there was a boat by the river bank, just where the guys were standing. We know that th 阅读全文
posted @ 2013-11-03 15:38 Oyking 阅读(417) 评论(0) 推荐(0) 编辑
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 29 下一页