LightOJ 1012.Guilty Prince-DFS】的更多相关文章

bfs遍历一遍就行了. /* *********************************************** Author :guanjun Created Time :2016/6/15 18:50:31 File Name :1012.cpp ************************************************ */ #include <iostream> #include <cstring> #include <cstdlib…
Guilty Prince  Time Limit: 2 second(s) Memory Limit: 32 MB Once there was a king named Akbar. He had a son named Shahjahan. For an unforgivable reason the king wanted him to leave the kingdom. Since he loved his son he decided his son would be banish…
题意:一共有 T 组测试数据,每组先给两个数,w,h,表示给一个 高h,宽w的矩阵,‘#’表示不能走,‘.’表示能走,‘@’表示起始点,问,从起始点出发能访问多少个点. 简单的BFS题,以前做过一次. #include<stdio.h> #include<string.h> struct node{ int x,y; }; node q[]; int head,tail; ][]; ,,-,}; ,,,-}; int w,h; int sx,sy; int ans; int OK(…
1.LightOJ 1012  Guilty Prince  简单bfs 2.总结:水 题意:迷宫,求有多少位置可去 #include<iostream> #include<cstring> #include<cmath> #include<queue> #include<algorithm> #include<cstdio> #define F(i,a,b) for (int i=a;i<=b;i++) using names…
Guilty Prince LightOJ - 1012 #include<cstdio> #include<cstring> ][]; int ans,h,w,T,TT; ][]; void dfs(int x,int y) { vis[x][y]=; ans++; &&!vis[x-][y]) dfs(x-,y); ][y]) dfs(x+,y); &&!vis[x][y-]) dfs(x,y-); ]) dfs(x,y+); } int mai…
水题,dfs #include<cstdio> #include<string> #include<cstring> #include<iostream> #include<algorithm> using namespace std; const int MAXN = 22; int W, H; char str[MAXN][MAXN], vis[MAXN][MAXN]; int dir[4][2] = {1, 0, 0, 1, -1, 0,…
1012 - Guilty Prince Time Limit: 2 second(s) Memory Limit: 32 MB Once there was a king named Akbar. He had a son named Shahjahan. For an unforgivable reason the king wanted him to leave the kingdom. Since he loved his son he decided his son would be…
提高自己的实力, 也为了证明, 开始板刷lightoj,每天题量>=1: 题目的类型会在这边说明,具体见分页博客: SUM=54; 1000 Greetings from LightOJ [简单A+B] 1001 Opposite Task  [简单题] 1002 Country Roads[搜索题] 1003 Drunk[判环] 1004 Monkey Banana Problem [基础DP] 1006 Hex-a-bonacci[记忆化搜索] 1008 Fibsieve`s Fantabu…
Guilty Prince  Time Limit: 2 second(s) Memory Limit: 32 MB Once there was a king named Akbar. He had a son named Shahjahan. For an unforgivable reason the king wanted him to leave the kingdom. Since he loved his son he decided his son would be banish…
1 获取一个简单的Docker系统镜像,并建立一个容器. 1.1 这里我选择下载CentOS镜像 docker pull centos 1.2 通过docker tag命令将下载的CentOS镜像名称换成centos,然后建立一个简单容器 docker run -it --name=client1 centos /bin/bash 2 Docker容器中下载并安装Java 2.1 JDK下载 去Oracle官网选择要下载的JDK http://www.oracle.com/technetwork…