hdu 4740 The Donkey of Gui Zhou】的更多相关文章

The Donkey of Gui Zhou Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=4740 Description There was no donkey in the province of Gui Zhou, China. A trouble maker shipped one and put it in the forest which could be…
Problem Description There was no donkey ,) , the down-right cell ,N-) and the cell below the up-left cell ,)..... A × grid is shown below: The donkey lived happily until it saw a tiger far away. The donkey had never seen a tiger ,and the tiger had ne…
题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=4740 [题意]: 森林里有一只驴和一只老虎,驴和老虎互相从来都没有见过,各自自己走过的地方不能走第二次,都会朝着一个方向走,直到这个方向不能走,然后转向,驴只会右转,老虎只会左转,当转过一次之后还是不能往前走,那么它就停下来不再移动了...问驴和老虎是否能相遇在一个坐标点... [题解]: 暴力搜索,模拟过程就能过,不存在超时问题 [code]: /* JudgeStatus:Accepted ti…
1.扯犊子超多if else 判断的代码,华丽丽的TLE. #include<stdio.h> #include<string.h> #define N 1010 int map[N][N]; ][]= {,,,,,-,-,}; struct Node { int x,y; int f; }; int main() { int n; Node tig,don; while(scanf("%d",&n)!=EOF&&n) { memset(…
由于一开始考虑的很不周到,找到很多bug.....越改越长,不忍直视. 不是写模拟的料...................... 反正撞墙或者碰到已经走过的点就会转向,转向后还碰到这两种情况就会傻站那不动了...... #include <iostream> #include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstrin…
Problem Description There was no donkey in the province of Gui Zhou, China. A trouble maker shipped one and put it in the forest which could be considered as an N×N grid. The coordinates of the up-left cell is (0,0) , the down-right cell is (N-1,N-1)…
题意: 给出老虎的起始点.方向和驴的起始点.方向.. 规定老虎和驴都不会走自己走过的方格,并且当没路走的时候,驴会右转,老虎会左转.. 当转了一次还没路走就会停下来.. 问他们有没有可能在某一格相遇.. 思路: 模拟,深搜.. 用类似时间戳的东西给方格标记上,表示某一秒正好走到该方格.. 最后遍历一下驴在某一格方格标记时间是否和老虎在该格标记的时间一样,一样代表正好做过这里了.. 还有一种情况就是老虎或驴一直停在那里,那就算不相等,也是可以的.. Tips: 我一直忘了老虎或驴停下来的情况,这样…
题目链接 老虎左拐,老鼠右拐,碰到不能走的拐一次,如果还不能走就停下,自己走过的不能走,求相遇的坐标或-1 一个停下之后,另一个还可以走 #include <cstdio> #include <cstring> using namespace std; #define N 1005 struct node { int x,y; }p[N*N],q[N*N]; int visi[N][N],xy[4][2]={{0,1},{1,0},{0,-1},{-1,0}}; int n; in…
九野的博客,转载请注明出处:http://blog.csdn.net/acmmmm/article/details/11711743 题意:驴和老虎在方格中跑,跑的方式:径直跑,若遇到边界或之前走过的点则转向,驴向右转,虎向左转,若转向后还不能跑则一直呆着不动, 问:他们是否会相遇,会输出相遇坐标,不会输出-1 #include <iostream> #include <algorithm> #include <cstdlib> #include <cstring…
The Donkey of Gui Zhou Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 389    Accepted Submission(s): 153 Problem Description There was no donkey in the province of Gui Zhou, China. A trouble m…