简单题View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>#include <queue>using namespace std;#define maxn 25struct XPoint{ int x, y;} a;bool map[maxn][maxn], vis[maxn][maxn];int n, m, ans;int dir[4][2] ={{ 0, 1 },{ 0, -1 },{ 1, 0 },{ -1, 0 }
转载 2011-06-08 16:38:00
89阅读
2评论
普通的DFS练习
转载 2016-06-14 23:16:00
47阅读
2评论
Description There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of four adjacent t
原创 2022-05-27 17:02:13
181阅读
Red and Black Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 47466   Accepted: 25523 Description There is a rectangular room, covered with square tiles. Each tile is colored either re
原创 2021-07-15 10:35:26
52阅读
Red and BlackTime Limit: 1000MS Memory Limit: 30000KTotal Submissio
原创 2022-08-05 10:55:33
44阅读
Red and BlackTime Limit: 1000MS   Memory Limit: 30
原创 2023-03-08 16:20:55
184阅读
挑战习题搜索-1 题意: 给定起点,然后求一个可以到达的数量,位置“.”都可以走。每次应该是上下左右都可以走。 思路: 这题应该DFS更好写,但是BFS也可以写吧。 好久没写了… dfs挫代码……..#include#include#include#include#includeu...
转载 2016-08-12 22:42:00
39阅读
注意char处理, when need to manipluate inputs, take care of previous chars, such as ‘\n’ #define LOCAL#include #include har map[SIZE][SIZE];int dir
原创 2023-08-23 09:53:17
77阅读
#includechar map[21][21];int c;int n,m;void count(char map[21][21],int i,int j){ map[i][j]='#'; if(i+1< m&&map[i+1][j]=='.'){ c++; count(map,i+1,j); } if(i-1>-1&&map
原创 2023-08-21 16:43:44
87阅读
问题链接:POJ1979 HDU1312 Red and Black。题意简述:输入正整数w和h,w为列数,h为行数。输入h×w矩阵 (1 #include #define DIRECTSIZE 4struct direct { int drow; int...
转载 2016-08-12 21:13:00
32阅读
2评论
问题链接:POJ1979 HDU1312 Red and Black。题意简述:输入正整数w和h,w为列数,h为行数。输入h×w矩阵 (1 #include #define DIRECTSIZE 4struct direct { int drow; int...
转载 2016-08-12 21:13:00
51阅读
2评论
Red and BlackTime Limit: 1000MSMemory Limit: 30000KTotal Submissions: 17061Accepted: 8996DescriptionThere is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of four adjacent tiles. But he can&
转载 2012-08-15 23:48:00
58阅读
2评论
水,不解释了#include#include#include#include#include#includeusing namespace std;const int sizen=150;int cnt;bool Map[sizen][sizen];int d[4][2]={1,0,-1,0,0,1,0,-1};void DFS(int x,int y){
原创 2023-08-23 09:57:52
51阅读
简单题 直接上代码 #include #include #include #include #include #include #include #include #include using namespace std; char a[30][30]; int ans ; int dfs (int x,int y) { if (a[x][y] =
原创 2023-03-03 12:34:24
193阅读
Red and Black Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 29990 Accepted: 16293 Description There is a rectangular room, covered with s
原创 2021-07-21 16:00:55
118阅读
题目链接:HDU1312 / POJ1979 / ZOJ2165 Red and Black(红与黑) Red and Black Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 9902    Accepted Submissi
转载 2016-02-21 17:51:00
98阅读
2评论
水过。注意边界不能超出。 #include <iostream> using namespace std; int n, m, sx, sy, dir[4][2] = {0, -1, 0, 1, 1, 0, -1, 0}, count; char diagram[23][23]; void get_
转载 2017-08-08 11:37:00
34阅读
blem/OpenJ_Bailian-2816 Red and Black Time Limit: 1000MS Memory Limit: 30000K Total Subm
原创 2022-06-02 12:58:13
39阅读
Red and BlackTime Limit:1000MSMemory Limit:30000KTotal Submissions:21482Accepted:11488DescriptionThere is a rectangular room, covered with square tile...
转载 2014-07-06 19:12:00
67阅读
2评论
Red and Black Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 41222 Accepted: 22338 Description There is a rectangular room, covered with s
转载 2018-04-29 08:03:00
82阅读
2评论
  • 1
  • 2
  • 3
  • 4
  • 5