DescriptionIgnatius had a nightmare last night. He found himself in a labyrinth with a time bomb on him. The labyrinth has an exit, Ignatius should ge...
分类:
Web程序 时间:
2014-12-16 06:28:33
阅读次数:
271
题目链接http://acm.hdu.edu.cn/showproblem.php?pid=1072这个题目难吗?,不难,但我做了很久,最后乱七八糟的A了,花了很多时间,A了之后才发现,是个水题,反思: 做题前,先把思路搞清,该如何做,这样做对不对,还有没有更好的方法,在草稿纸上把思路理清,哪些地方...
分类:
Web程序 时间:
2014-11-30 16:50:26
阅读次数:
209
今天将介绍一款自动化测试套件名叫nightmare,他是一个基于phantomjs的测试框架,一个基于phantomjs之上为测试应用封装的一套high level API。其API以goto, refresh, click, type…等简单的常用e2e测试动作封装,使得其语义清晰,简洁。其官方在...
分类:
Web程序 时间:
2014-11-20 20:19:16
阅读次数:
210
DescriptionFarmer John's pastoral neighborhood has N farms (2 #include#include#include#includeusing namespace std;struct use{int st,en,ti,yu;}a[40001]...
分类:
Web程序 时间:
2014-11-05 16:23:53
阅读次数:
255
题目大意:自行脑补。
思路:维护两个维度上的带权并查集即可。
注意对于题目给出的一堆关系,我们应该添加两对关系。
Code:
#include
#include
#include
#include
#include
using
namespace
std;
#define
N ...
分类:
Web程序 时间:
2014-10-21 17:46:48
阅读次数:
207
Nightmare
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 7367 Accepted Submission(s): 3530
Problem Description
Ignatius had a n...
分类:
Web程序 时间:
2014-10-21 07:50:00
阅读次数:
202
题目大意:一些农场由一些东西向或者南北向的路相互连接。在不断加边的过程中会询问两个农场的曼哈顿距离是多少,如果目前还不连通,那么输出-1。
思路:带权并查集,f[i]为点i到father[i]的距离,要维护两个值,一个是东西向的距离,一个是南北向的距离,因为以后更新的时候要用到。在合并的时候有些特殊。现在有一条边(x->y),设fx为x的根,fy为y的根,那么现在知道f到fx的距离,y到...
分类:
Web程序 时间:
2014-10-10 15:36:14
阅读次数:
281
题目大意:给定一些点之间的位置关系,求两个点之间的曼哈顿距离
此题土豪题,不过POJ也有一道同样的题,可以刷一下
别被题目坑到了,这题不强制在线,把询问离线处理即可
然后就是带权并查集的问题了。。。将权值设为方向向量,重载+和-,按照正常权值并查集做就行了
#include
#include
#include
#include
#define M 40400
using namespace...
分类:
Web程序 时间:
2014-10-09 23:28:21
阅读次数:
274
Nightmare
Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d
& %I64u
Description
Ignatius had a nightmare last night. He found himself in a labyrinth with a time bomb on...
分类:
Web程序 时间:
2014-08-30 08:48:19
阅读次数:
264
Problem Description
Last night, little erriyue had a horrible nightmare. He dreamed that he and his girl friend were trapped in a big maze separately. More terribly, there are two ghosts in the maz...
分类:
Web程序 时间:
2014-08-27 22:03:18
阅读次数:
255