백준 2468번 안전영역(C++)
문제정답 코드#include #include #include #include #include #define X first #define Y second using namespace std; const int dx[]= {0,1,0,-1}; const int dy[]= {1,0,-1,0}; int main() { ios :: sync_with_stdio(0); cin.tie(0); int n; cin >> n; vector arr(n,vector(n,0)); vector vis(n,vector(n,0)); for (int i=0;i > arr[i][j]; } } int len = 1; int result = -1; int max = 1; while (result !=0) { result = 0; for (..
2023. 1. 5.
백준 1012번(C++)
문제정답 코드#include #include #include #include using namespace std; const int mx[] = {0,1,0,-1}; const int my[] = {1,0,-1,0}; int main() { int t,m,n,k; cin >> t; int cnt = 0; for (int i =0; i > m >> n>> k; vector arr(n,vector(m,0)); vector vis(n,vector(m,0)); for (int j =0; j > x>> y; arr[y][x] = 1; } for (int iy = 0;iy < n;iy++) { for (int ix = 0;ix < m;ix++..
2023. 1. 5.