結果
問題 |
No.1133 キムワイプイーター
|
ユーザー |
![]() |
提出日時 | 2020-11-10 07:00:50 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 544 bytes |
コンパイル時間 | 734 ms |
コンパイル使用メモリ | 72,192 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-22 17:11:03 |
合計ジャッジ時間 | 5,885 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 1 RE * 1 |
other | WA * 11 RE * 20 |
ソースコード
#include <iostream> #include <string> #include <vector> using namespace std; int main(){ int n, m; cin >> n >> m; string s; cin >> s; vector<vector<int>> a(n, vector<int>(n, 1)); a[0][0] = 0; int y = 0, x = 0; for (int i = 0; i < m; i++){ if (s[i] == 'U'){ y++; } if (s[i] == 'R'){ x++; } if (s[i] == 'L'){ x--; } if (s[i] == 'D'){ y--; } a[y][x] = 0; } for (int i = n - 1; i >= 0; i--){ for (int j = 0; j < n; j++){ cout << a[i][j]; if (j < n - 1){ cout << ' '; } } cout << endl; } }