[백준][14503번][시뮬레이션] 로봇 청소기
iSharp https://www.acmicpc.net/problem/14503 #include #include #include #include #include using namespace std; int n, m, r, c, d, dir = 0; //0123 북동남서 int map[51][51]; int visit[51][51]; // 청소안한곳 0, 벽이면 -1 int dx[4] = { -1,0,1,0 }; int dy[4] = { 0,1,0,-1 }; int solve(int a, int b, int cnt, int dir) { if (visit[a][b] == 0) { visit[a][b] = cnt; cnt++; } /* if (cnt == 60) { cout 0) && (visit[a][b +..
[백준][3568번][시뮬레이션] iSharp
iSharp https://www.acmicpc.net/problem/3568 #include #include #include #include #include using namespace std; string a,b,c,d,e,temp,ans1,ans2; int main() { ios::sync_with_stdio(false); cin.tie(NULL); getline(cin, a); for (int i = 0; i < a.size(); i++) { if (a[i] == ' ') { b = a.substr(0, i); c = a.substr(i+1); break; } } int cnt = 0; for (int i = 0; i < c.size(); i++) { if (c[i] == ',' || c[i] =..