http://poj.org/problem?id=1573

 #include<stdio.h>
#include<stdlib.h>
#include<cstring> int main()
{
int step[][],n,m,x,y,s;
int visit[][];
char map[][];
while(scanf("%d%d%d",&n,&m,&y),n||m||y)
{
/*for(int i=1;i<=n;i++)
{
scanf("%s",map[i]+1);
}*/
for(int i = ; i <= n ; i ++)
{
getchar();//吃掉换行
for(int j = ; j <= m ; j++)
{
scanf("%c",&map[i][j]) ;
}
}
memset(visit,,sizeof(visit));
s=,x=,visit[x][y]=,step[x][y]=s;
while()
{
switch(map[x][y])
{
case 'N': x--;break;
case 'S': x++;break;
case 'E': y++;break;
case 'W': y--;break;
}
s++;
if(visit[x][y])
{
printf("%d step(s) before a loop of %d step(s)\n",step[x][y], s-step[x][y]);
break;
}
visit[x][y]=;
step[x][y]=s;
if(x< || y< || x>n || y>m)
{
printf("%d step(s) to exit\n",s);
break;
}
}
}
return ;
}

呜啦啦,又是模拟题,这个题又被虐了好长时间,不过倒是挺好做的感觉

POJ1573Robot Motion的更多相关文章

  1. Rigid motion segmentation

    In computer vision, rigid motion segmentation is the process of separating regions, features, or tra ...

  2. 一个简单的游戏开发框架(七.动作Motion)

    发现还没谈到最基本也是最重要的问题,怎么画图,画动画? 在原版cocos2d-x里画动画比较麻烦,见cocos2d-x学习笔记04:简单动画 cocostudio扩展出CCArmature类,就比较简 ...

  3. linux下motion摄像头监控编译与配置

    利用linxu下的开源的motion搭建嵌入式视频动态监控系统 所谓移动图像监测,简单来说就是利用摄像头定点监测某个区域,当有移动物体经过时,摄像头便自动抓拍(要监测多大物体.按拍照速率都是可调的), ...

  4. poj1573 Robot Motion

    Robot Motion Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 12507   Accepted: 6070 Des ...

  5. HTC Vive 与Leap Motion 出现位置错误的问题

    Leap Motion已经支持VR, 但是官方没有支持HTC Vive的例子. 按照官方的文档, 其实是有问题的: https://developer.leapmotion.com/documenta ...

  6. Leap Motion发布新平台,直击下一代移动端VR/AR手部追踪

    2013年,动作捕捉技术公司Leap Motion发布了面向PC的体感控制器,不过销量并不乐观.随着2014年虚拟现实技术的再一次兴起,它发布一款用于Oculus Rift的附加设备,从而正式登上VR ...

  7. Motion images compression and restoration based on computer vision

    This technique should apply to both normal video (consequtive sequences of pictures of real world) a ...

  8. Unity学习疑问记录之Apply Root Motion

    Should we control the character's position from the animation itself or from script. 如果我们勾选了Animator ...

  9. [转]第四章 使用OpenCV探测来至运动的结构——Chapter 4:Exploring Structure from Motion Using OpenCV

    仅供参考,还未运行程序,理解部分有误,请参考英文原版. 绿色部分非文章内容,是个人理解. 转载请注明:http://blog.csdn.net/raby_gyl/article/details/174 ...

随机推荐

  1. NSURLConnection ignore unverified certificate error when sending a synchronise request

    Private API, use with caution. As we all know, it's easy to ignore the unverified certificate error ...

  2. 通过Driver获取数据库连接

    先看一下文件,在当前包下有一个properties配置文件,在根目录下有一个lib文件夹,里面放的是mySql的驱动jar包 Driver :是一个接口,数据库厂商必须提供实现的接口,能从其中获取数据 ...

  3. 运行maven报错:经过检查是因为maven不兼容jdk1.6,重新安装1.7解决

    cmd mvn -v报错: Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apach ...

  4. VIM中的寄存器简介

    原来在vim粘贴从其他地方复制过来的文本的时候,一直用的shift + inert,那时就想,能不能够直接就像p那样粘贴,不必非得进入插入模式再来粘贴.后来看了<vim实用技巧>上关于vi ...

  5. ECMAScript整理笔记(持续更新....)

    参考文献: ECMAScript Array:http://www.jimmycuadra.com/posts/ecmascript-5-array-methods ECMAScript5兼容展示大全 ...

  6. 纯css3的上下左右提示框几种方法

    经常用到三角形提示框,用图片吧,大小框不定,所以,css自己写了,可设置宽高比,就可自适应了. 图形例子如下: css代码如下 <style type="text/css"& ...

  7. Docs list

    http://www.deansys.com/doc/ldd3/index.html Github中文文档: http://www.worldhello.net/gotgithub/03-projec ...

  8. 【BZOJ 1188】 [HNOI2007]分裂游戏

    Description 聪聪和睿睿最近迷上了一款叫做分裂的游戏. 该游戏的规则试: 共有 n 个瓶子, 标号为 0,1,2.....n-1, 第 i 个瓶子中装有 p[i]颗巧克力豆,两个人轮流取豆子 ...

  9. JPA学习---第三节:搭建JPA开发环境和全局事务介绍

    一.创建 Java 项目 1.导入所需的 jar 包: 2.创建 persistence.xml 文件, 代码如下: <?xml version="1.0" encoding ...

  10. Sublime Text 2 入门

    SublimeText 2 的介绍视频: http://player.youku.com/player.php/partnerid/XOTcy/sid/XMzU5NzQ5ODgw/v.swf   以下 ...