結果
問題 |
No.1133 キムワイプイーター
|
ユーザー |
|
提出日時 | 2020-08-01 08:16:36 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 19 ms / 2,000 ms |
コード長 | 975 bytes |
コンパイル時間 | 3,077 ms |
コンパイル使用メモリ | 108,108 KB |
最終ジャッジ日時 | 2025-01-12 12:17:07 |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 31 |
ソースコード
#include <iostream> #include <vector> #include <algorithm> #include <map> #include <queue> #include <cstdio> #include <ctime> #include <assert.h> #include <chrono> #include <random> #include <numeric> #include <set> #include <deque> #include <stack> using namespace std; typedef long long int ll; typedef unsigned long long ull; mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count()); ll myRand(ll B) { return (ull)rng() % B; } bool used[222][222]; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int n,m; cin >> n >> m; used[0][0]=1; int x=0,y=0; string s; cin >> s; for(int i=0;i<m;i++){ if(s[i]=='U')x++; if(s[i]=='D')x--; if(s[i]=='R')y++; if(s[i]=='L')y--; if(0<=x&&x<=n&&0<=y&&y<=n){ used[x][y]=1; } } for(int i=n;i>=0;i--){ for(int j=0;j<=n;j++){ printf("%d ",(used[i][j])^1 ); } printf("\n"); } }