D - (热身)简单宽搜回顾 Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit Status 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…
简单的BFS,练习基础 #include<bits/stdc++.h> #define rep(i,x,y) for(register int i=x;i<=y;i++) #define dec(i,x,y) for(register int i=x;i>=y;i--) #define LL long long #define In freopen("7.in","r",stdin) #define In2 freopen("8.i…
Problem 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 down. You…
The Game 题意: Description One morning, you wake up and think: "I am such a good programmer. Why not make some money?" So you decide to write a computer game. 一天清晨,你起床后想到:"我是一个这么牛的程序员,为什么不赚点钱呢?"所以,你决定写一个电脑游戏. The game takes place on a re…
Walking Ant Time Limit: 2 Seconds Memory Limit: 65536 KB Ants are quite diligent. They sometimes build their nests beneath flagstones. Here, an ant is walking in a rectangular area tiled with square flagstones, seeking the only hole leading to h…
胜利大逃亡 Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 21449 Accepted Submission(s): 8442 Problem Description Ignatius被魔王抓走了,有一天魔王出差去了,这可是Ignatius逃亡的好机会. 魔王住在一个城堡里,城堡是一个A*B*C的立方体,可以被表示成A个B*C的…
题意:给定农夫和奶牛的初始位置,农夫可以当前位置+1.-1.*2三种移动方式,问最少需要多少分钟抓住奶牛 AC代码: #include<cstdio> #include<cstring> #include<queue> using namespace std; const int maxn=100000+5; const int dx[]={-1,1,2}; int d[maxn]; int n,k; int bfs(){ queue<int>q; mems…
题意:坐电梯,每次可以选着上下,对应移动的楼层是Ki,问从起点到终点最少要按几次. AC代码: #include<cstdio> #include<cstring> #include<queue> using namespace std; const int maxn=205; int n,a,b; int d[maxn],p[maxn]; const int dx[]={-1,1}; int bfs(){ queue<int>q; memset(d,-1,…
题目链接:http://codeforces.com/gym/100971/problem/J J. Robots at Warehouse time limit per test 2.0 s memory limit per test 256 MB input standard input output standard output Vitaly works at the warehouse. The warehouse can be represented as a grid of n ×…
J - Goblin Wars Time Limit:432MS Memory Limit:1572864KB 64bit IO Format:%lld & %llu SubmitStatusPracticeSPOJ AMR11J Description The wizards and witches of Hogwarts School of Witchcraft found Prof. Binn's History of Magic lesson to be no less bo…
A. Shortest path of the king time limit per test 1 second memory limit per test 64 megabytes input standard input output standard output The king is left alone on the chessboard. In spite of this loneliness, he doesn't lose heart, because he has busi…
非常可乐 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 10442 Accepted Submission(s): 4193 Problem Description 大家一定觉的运动以后喝可乐是一件很惬意的事情,但是seeyou却不这么认为.因为每次当seeyou买了可乐以后,阿牛就要求和seeyou一起分享这一瓶可乐,而且一定要…
Image Perimeters Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 8594 Accepted: 5145 Description Technicians in a pathology lab analyze digitized images of slides. Objects on a slide are selected for analysis by a mouse click on the object…