結果
| 問題 | No.1133 キムワイプイーター |
| ユーザー |
leafirby
|
| 提出日時 | 2020-07-26 15:24:40 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 27 ms / 2,000 ms |
| コード長 | 661 bytes |
| 記録 | |
| コンパイル時間 | 2,057 ms |
| コンパイル使用メモリ | 199,788 KB |
| 最終ジャッジ日時 | 2025-01-12 06:00:40 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 31 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, 1, -1};
int main(){
int N, M, x, y = 0;
string S;
cin >> N >> M >> S;
x = N;
vector<vector<bool>> seen(N + 1, vector<bool>(N + 1, true));
seen[x][y] = false;
for (auto c : S) {
int flag = -1;
if (c == 'D') {
flag = 0;
} else if (c == 'U') {
flag = 1;
} else if (c == 'R') {
flag = 2;
} else {
flag = 3;
}
x += dx[flag];
y += dy[flag];
seen[x][y] = false;
}
for (int i = 0; i < N + 1; i++) {
for (int j = 0; j < N + 1; j++) {
cout << seen[i][j] << " ";
}
cout << endl;
}
}
leafirby