ZOJ 1056 The Worm Turns】的更多相关文章

原题链接 题目大意:贪吃蛇的简化版,给出一串操作命令,求蛇的最终状态是死是活. 解法:这条蛇一共20格的长度,所以用一个20个元素的队列表示,队列的每个元素是平面的坐标.每读入一条指令,判断其是否越界,是否咬到了自己.若都没有,把改点压入队列,front元素弹出. 参考代码: #include<iostream> #include<queue> #include<string> using namespace std; struct Point{ int r; int…
191.   The Worm Turns Time Limit: 1.0 Seconds   Memory Limit: 65536K Total Runs: 5465   Accepted Runs: 1774 Worm is an old computer game. There are many versions, but all involve maneuvering a "worm" around the screen, trying to avoid running th…
The Worm Turns Time Limit: 8000/4000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 106 Accepted Submission(s): 54   Problem Description Winston the Worm just woke up in a fresh rectangular patch of earth. The rectang…
B - The Worm Turns Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%lld & %llu Submit Status Description Worm is an old computer game. There are many versions, but all involve maneuvering a "worm" around the screen, trying to…
Winston the Worm just woke up in a fresh rectangular patch of earth. The rectangular patch is divided into cells, and each cell contains either food or a rock. Winston wanders aimlessly for a while until he gets hungry; then he immediately eats the f…
DFS. /* 2782 */ #include <iostream> #include <queue> #include <cstdio> #include <cstring> #include <cstdlib> using namespace std; #define MAXN 650 int n, m; bool visit[MAXN][MAXN]; int ansd, ansx, ansy, ansb; ][] = { // E, N,…
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=494 题目大意: 一只蜗牛要从爬上n英寸高的地方,他速度为u每分钟,他爬完u需要休息1分钟,且他休息时下滑d英寸,问他什么时候爬出去. 吐槽: 小学的数学题编程了编程题,简直丧心病狂. 思路: 数据量小直接模拟即可. 也可以用数学推导 模拟板: #include<cstdio> int main() { int n,u,d; while(~scanf("%d%d%d…
acm之pku题目分类 对ACM有兴趣的同学们可以看看 DP:  1011   NTA                 简单题  1013   Great Equipment     简单题  1024   Calendar Game       简单题  1027   Human Gene Functions   简单题  1037   Gridland            简单题  1052   Algernon s Noxious Emissions 简单题  1409   Commun…
以下是poj百道水题,新手可以考虑从这里刷起 搜索1002 Fire Net1004 Anagrams by Stack1005 Jugs1008 Gnome Tetravex1091 Knight Moves1101 Gamblers1204 Additive equations 1221 Risk1230 Legendary Pokemon1249 Pushing Boxes 1364 Machine Schedule1368 BOAT1406 Jungle Roads1411 Annive…
杭电ACM分类: 1001 整数求和 水题1002 C语言实验题——两个数比较 水题1003 1.2.3.4.5... 简单题1004 渊子赛马 排序+贪心的方法归并1005 Hero In Maze 广度搜索1006 Redraiment猜想 数论:容斥定理1007 童年生活二三事 递推题1008 University 简单hash1009 目标柏林 简单模拟题1010 Rails 模拟题(堆栈)1011 Box of Bricks 简单题1012 IMMEDIATE DECODABILITY…