結果

問題 No.1133 キムワイプイーター
ユーザー evawenis
提出日時 2020-08-15 01:27:22
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 31 ms / 2,000 ms
コード長 492 bytes
コンパイル時間 2,146 ms
コンパイル使用メモリ 199,088 KB
最終ジャッジ日時 2025-01-13 00:51:03
ジャッジサーバーID
(参考情報)
judge5 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

int main(){
	cin.tie(0),ios::sync_with_stdio(false);
	int n,m; cin>>n>>m; ++n;
	vector<vector<bool>>ans(n,vector<bool>(n,true));
	ans.front().front()=false;
	int y=0,x=0;
	for(int i=0;i<m;++i){
		char s; cin>>s;
		if(s=='U')++y;
		else if(s=='R')++x;
		else if(s=='L')--x;
		else --y;
		ans.at(y).at(x)=false;
	}
	for(int i=n-1;i>=0;--i){
		cout<<ans.at(i).front();
		for(int j=1;j<n;++j){
			cout<<" "s<<ans.at(i).at(j);
		}
		cout<<"\n"s;
	}
}
0