题意: 给一个n*m的矩阵作为地图,0为通路,1为阻碍.只能向上下左右四个方向走.每一年会在一个通路上长出一个阻碍,求第几年最上面一行与最下面一行会被隔开. 输入: 首行一个整数t,表示共有t组数据. 每组数据首行两个整数n, m,表示矩阵大小. 接下来输入矩阵. 接下来输入一个整数q,表示一共q年. 接下来q行,第i行为两个整数xi, yi,表示在第i年会在xi, yi长出一个阻碍.数据保证只会在通路上生成阻碍. 输出: 如果在第i年被隔开,则输出i.如果始终无法隔开,则输出-1. 吐槽: 我…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5652 题意: 很久以前,中国和印度之间并没有喜马拉雅山相隔,两国的文化交流很频繁.随着喜马拉雅山海拔逐渐增加,两个地区的交流也越来越少,最终没有了来往. 假设当时的地形和我画的一样,蓝色部分代表海洋,而且当时人们还没有发明轮船.黄色部分代表沙漠,而且沙漠上经常有野鬼散步,所以人们不敢到沙漠中行走.黑色的格子表示山峰,这些山峰都无比高大,所以人无法穿过.白色格子代表平原,人可以在平原上自由行走.人每次…
题目链接: India and China Origins Time Limit: 2000/2000 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 685    Accepted Submission(s): 230 Problem Description A long time ago there are no himalayas between India and Chi…
India and China Origins 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5652 Description A long time ago there are no himalayas between India and China, the both cultures are frequently exchanged and are kept in sync at that time, but eventually hima…
India and China Origins  Accepts: 49  Submissions: 426  Time Limit: 2000/2000 MS (Java/Others)  Memory Limit: 65536/65536 K (Java/Others) 问题描述 很久以前,中国和印度之间并没有喜马拉雅山相隔,两国的文化交流很频繁.随着喜马拉雅山海拔逐渐增加,两个地区的交流也越来越少,最终没有了来往. 假设当时的地形和我画的一样,蓝色部分代表海洋,而且当时人们还没有发明轮船.…
India and China Origins Time Limit: 2000/2000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Problem Description A long time ago there are no himalayas between India and China, the both cultures are frequently exchanged and are kept in…
India and China Origins Time Limit: 2000/2000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 676    Accepted Submission(s): 227 Problem Description A long time ago there are no himalayas between India and China, the…
India and China Origins Time Limit: 2000/2000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 441    Accepted Submission(s): 133 Problem Description A long time ago there are no himalayas between India and China, th…
题面 给一个 N N N 点 M M M 边的简单无向图,询问 Q Q Q 次,每次问你把编号在 [ l i , r i ] [l_i,r_i] [li​,ri​] 之间的边删掉后,该图是否存在奇数环,即是否不能被二染色. 1 ≤ N , M , Q ≤ 200000 1\leq N,M,Q\leq 200000 1≤N,M,Q≤200000. 题解 看了半天才搞懂官解里的奇怪分治是什么,其实就是整体二分嘛! 部分分就不多赘述了,大概就是一步步引导我们到正解的整体二分+可回退并查集(官解称其为:…
题目链接:http://acm.split.hdu.edu.cn/showproblem.php?pid=5652 Problem Description A long time ago there are no himalayas between India and China, the both cultures are frequently exchanged and are kept in sync at that time, but eventually himalayas rise…