結果
問題 |
No.1133 キムワイプイーター
|
ユーザー |
|
提出日時 | 2020-07-28 17:10:22 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 31 ms / 2,000 ms |
コード長 | 556 bytes |
コンパイル時間 | 1,981 ms |
コンパイル使用メモリ | 198,540 KB |
最終ジャッジ日時 | 2025-01-12 07:15:29 |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 31 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; string s; cin >> s; vector<vector<int>> v(n+1, vector<int>(n+1, 1)); int x = 0; int y = 0; v[x][y] = 0; for(char c : s) { if(c == 'R') ++x; else if(c == 'L') --x; else if(c == 'U') ++y; else if(c == 'D') --y; v[y][x] = 0; } for(int i = n; i >= 0; --i) { for(int j = 0; j <= n; ++j) { printf("%d ", v[i][j]); } printf("\n"); } return 0; }