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 the land into numerous square plots. It then analyze…
F - Oil Deposits Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Description GeoSurvComp地质调查公司负责探测地下石油储藏. GeoSurvComp现在在一块矩形区域探测石油,并把这个大区域分成了很多小块.他们通过专业设备,来分析每个小块中是否蕴藏石油.如果这些蕴藏石油的小方格相邻,那么他们被认为是同一油藏的一部分.在这块矩形区域,可能有很多油藏.你的任…
链接 : Here! 思路 : 搜索判断连通块个数, 所以 $DFS$ 或则 $BFS$ 都行喽...., 首先记录一下整个地图中所有$Oil$的个数, 然后遍历整个地图, 从油田开始搜索它所能连通多少块其他油田, 只需要把它所连通的油田个数减去, 就ok了 /************************************************************************* > File Name: E.cpp > Author: > Mail: >…
Angel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M <= 200) matrix. There are WALLs, ROADs, and GUARDs in the prison. Angel's friends want to save Angel. Their task is: approach Angel. We assume…
4月16日,日本熊本地区强震后,受灾严重的阿苏市一养猪场倒塌,幸运的是,猪圈里很多头猪依然坚强存活.当地15名消防员耗时一天解救围困的“猪坚强”.不过与在废墟中靠吃木炭饮雨水存活36天的中国汶川“猪坚强”相比,熊本的猪可没那么幸运,因为它们最终还是没能逃过被送往屠宰场的命运.   我们假设“猪坚强”被困在一个N*M的废墟中,其中“@”表示“猪坚强”的位置,“.”表示可以直接通过的空地,“#”表示不能拆毁的障碍物,“*”表示可以拆毁的障碍物,那么请问消防员至少要拆毁多少个障碍物,才能从废墟中救出“…
ACM小组的Samsara和Staginner对中国象棋特别感兴趣,尤其对马(可能是因为这个棋子的走法比较多吧)的使用进行深入研究.今天他们又在 构思一个古怪的棋局:假如Samsara只有一个马了,而Staginner又只剩下一个将,两个棋子都在棋盘的一边,马不能出这一半棋盘的范围,另外这 一半棋盘的大小很奇特(n行m列).Samsara想知道他的马最少需要跳几次才能吃掉Staginner的将(我们假定其不会移动).当然这个光荣的任 务就落在了会编程的你的身上了. Input 每组数据一行,分别…
Oil Deposits Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 8274 Accepted Submission(s): 4860 Problem Description The GeoSurvComp geologic survey company is responsible for detecting underground…
Oil Deposits Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 15533    Accepted Submission(s): 8911 Problem Description The GeoSurvComp geologic survey company is responsible for detecting underg…
Description 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 the land into numerous square plots. It…
Description 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 the land into numerous square plots. It…