题目链接:[HDU - 1754]
很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。
这让很多学生很反感。
不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同...
阅读全文...
线段树 HDU-1166 敌兵布阵
题目链接:[HDU - 1166]
C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监...
阅读全文...
阅读全文...
贪心 POJ-3617 Best Cow Line
题目链接:[ POJ - 3617 ]
FJ is about to take his N (1 ≤ N ≤ 2,000) cows to the annual"Farmer of the Year" competition. In this con...
阅读全文...
阅读全文...
贪心 POJ-2376 Cleaning Shifts
题目链接:[ POJ - 2376 ]
Farmer John is assigning some of his N (1 <= N <= 25,000) cows to do some cleaning chores around th...
阅读全文...
阅读全文...
DFS 图的联通块 UVA-572 Oil Deposits
题目链接:[ UVA - 572 ]
The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits....
阅读全文...
阅读全文...
DFS POJ-2386 Lake Counting
[POJ - 2386]
Due to recent rains, water has pooled in various places in Farmer John's field, which is represented by a rectan...
阅读全文...
阅读全文...
DFS 图的联通块 POJ-1979 Red and Black
[ POJ - 1979]
Here is a rectangular room, covered with square tiles. Each tile is colored either red or black. A ...
阅读全文...
阅读全文...
DFS 图的联通块 AOJ-0118 Property Distribution
[ Aizu - 0118 ]
这道题类似于联通图问题,将联通的归成一个,数一下总共有几个即可。
因为题目告诉不会有空格,所以排除标记用空格表示即可。
Sample Input
10 10
####*****@
@#@@@@#*#*
@##***@@...
阅读全文...
阅读全文...
BFS 图的最短路径 Aizu-0558 Cheese
[ Aizu - 0558 ]
大意:在H * W的地图上有N个奶酪工厂,每个工厂分别生产硬度为1-N的奶酪。有一只老鼠准备从出发点吃遍每一个工厂的奶酪。老鼠有一个体力值,初始时为1,每吃一个工厂的奶酪体力值增加1(每个工厂只能吃一次),且老鼠只能吃...
阅读全文...
阅读全文...