結果
| 問題 | No.1133 キムワイプイーター |
| ユーザー |
SSRS
|
| 提出日時 | 2020-11-10 07:02:09 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 20 ms / 2,000 ms |
| コード長 | 545 bytes |
| 記録 | |
| コンパイル時間 | 455 ms |
| コンパイル使用メモリ | 84,764 KB |
| 実行使用メモリ | 7,972 KB |
| 最終ジャッジ日時 | 2026-04-03 10:10:01 |
| 合計ジャッジ時間 | 1,916 ms |
|
ジャッジサーバーID (参考情報) |
judge4_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 31 |
ソースコード
#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 + 1, vector<int>(n + 1, 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; i >= 0; i--){
for (int j = 0; j <= n; j++){
cout << a[i][j];
if (j < n){
cout << ' ';
}
}
cout << endl;
}
}
SSRS