题目传送门 题意:一个人去救女朋友,两个人都在运动,还有鬼在"扩散",问最少几秒救到女朋友 分析:开两个队列来表示两个人走过的路,一个人走到的地方另一个人已经vis了,那么就是相遇了,鬼就用曼哈顿距离判断. #include <bits/stdc++.h> using namespace std; const int N = 8e2 + 5; char maze[N][N]; int n, m; bool vis[N][N][2]; int dx[4] = {-1, 1,…
HDU 3085 Nightmare Ⅱ(噩梦 Ⅱ) Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Problem Description - 题目描述 Last night, little erriyue had a horrible nightmare. He dreamed that he and his girl friend were trapped in a…
Nightmare Ⅱ Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 886 Accepted Submission(s): 185 Problem Description Last night, little erriyue had a horrible nightmare. He dreamed that he and hi…
Nightmare Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8480 Accepted Submission(s): 4069 Problem Description Ignatius had a nightmare last night. He found himself in a labyrinth with a tim…
J - Nightmare Ignatius had a nightmare last night. He found himself in a labyrinth with a time bomb on him. The labyrinth has an exit, Ignatius should get out of the labyrinth before the bomb explodes. The initial exploding time of the bomb is set to…
http://acm.hdu.edu.cn/showproblem.php?pid=2612 Find a way Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 32208 Accepted Submission(s): 10316 Problem Description Pass a year learning in Hangz…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3085 Nightmare Ⅱ Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2790 Accepted Submission(s): 781 Problem Description Last night, little erriyu…
HDOJ 1312 Red and Black http://acm.hdu.edu.cn/showproblem.php?pid=1312 很裸的dfs,在dfs里面写上ans++,能到几个点就调了几次dfs,最后ans就是答案 #include<cstdio> #include<iostream> using namespace std; ][]; int n,m,si,sj,ans; ][] = {{,}, {-,}, {,-}, {,}}; int dfs(int x, i…
POJ 1915 Knight Moves Knight Moves Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 29912 Accepted: 14058 Description Background Mr Somurolov, fabulous chess-gamer indeed, asserts that no one else but him can move knights from one pos…