[백준] C++ 1012번:유기농배추
·
알고리즘
#include using namespace std;int dx[4] = {1 , 0 , -1 , 0};int dy[4] = {0, -1, 0, 1};int main(){ ios::sync_with_stdio(0); cin.tie(0); int t; cin >> t; for (int r = 0; r > q; int y, x; // x: 가로 , y: 세로 cin >> x >> y; vector> v(y, vector(x, 0)); vector> vis(y, vector(x, 0)); int k; cin >> k; for (int i = 0; i > xx >> yy; v[y..