結果
| 問題 |
No.1133 キムワイプイーター
|
| ユーザー |
|
| 提出日時 | 2022-07-13 01:33:34 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 30 ms / 2,000 ms |
| コード長 | 548 bytes |
| コンパイル時間 | 2,001 ms |
| コンパイル使用メモリ | 172,128 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-23 23:36:01 |
| 合計ジャッジ時間 | 3,651 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 31 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
int n, m, y, x;
string s;
cin >> n >> m >> s;
y = n++, x = 0;
vector<vector<int>> ans(n, vector<int>(n, 1));
ans[y][x] = 0;
for(int i = 0; i < m; i++){
if(s[i] == 'U')y--;
if(s[i] == 'D')y++;
if(s[i] == 'R')x++;
if(s[i] == 'L')x--;
ans[y][x] = 0;
}
for(int i = 0; i < n; i++){
for(int j = 0; j < n; j++){
if(j)cout << ' ';
cout << ans[i][j];
}
cout << '\n';
}
}