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…
Dungeon Master Description You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with rock. It takes one minute to move one unit north, south, east, west, up or dow…
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…
题目 题目 分析 双向bfs,对着书打的,我还调了好久. 代码 #include<cstdio> #include<cstring> #include<cctype> #include<queue> using namespace std; const int maxs=20,maxn=150; const int dx[]={1,-1,0,0,0},dy[]={0,0,1,-1,0}; int s[3],t[3]; int deg[maxn…
Description Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and the cow is at a point K (0 ≤ K ≤ 100,000) on the same number line. Farmer Jo…
[poj1137] The New Villa Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 1481 Accepted: 485 Description Mr. Black recently bought a villa in the countryside. Only one thing bothers him: although there are light switches in most rooms, t…
变形课 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/65536 K (Java/Others) Total Submission(s): 29518 Accepted Submission(s): 10683 Problem Description 呃......变形课上Harry碰到了一点小麻烦,因为他并不像Hermione那样能够记住所有的咒语而随意的将一个棒球变成刺猬什么的,但是他发现了变形咒语的一个统一规律:如果…