(BOJ) 3055 풀이
#include #include using namespace std; typedef struct xy{ int x,y; char t; }xy; xy dest,start; int R,C; char ar[52][52]={0,}; int visited[52][52]={0,}; int water[52][52]={0,}; int dx[4]={0,1,0,-1}; int dy[4]={-1,0,1,0}; queue q; void BFS(int y,int x){ q.push({x,y,'.'}); int flag=0; while(!q.empty()){ int x=q.front().x; int y=q.front().y; int t=q.front().t; q.pop(); for(int i=0;i
2022. 1. 14.
(BOJ) 2667 풀이
#include #include #include using namespace std; int map[26][26]={0,}; int visit[26][26]={0,}; int yy[]={0,-1,0,1}; int xx[]={-1,0,1,0}; int N; int DFS(int y,int x,int c){ if (y = N || x >= N || map[y][x] == 0) return 0; visit[y][x]=1; for(int asdf=0;asdf
2022. 1. 11.