結果

問題 No.1133 キムワイプイーター
ユーザー SSRSSSRS
提出日時 2020-11-10 07:00:50
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 544 bytes
コンパイル時間 592 ms
コンパイル使用メモリ 72,728 KB
実行使用メモリ 4,488 KB
最終ジャッジ日時 2023-09-29 23:12:54
合計ジャッジ時間 6,429 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 WA -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 RE -
testcase_24 RE -
testcase_25 WA -
testcase_26 WA -
testcase_27 RE -
testcase_28 RE -
testcase_29 WA -
testcase_30 WA -
testcase_31 RE -
testcase_32 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
	}
}
0