結果
| 問題 |
No.1133 キムワイプイーター
|
| ユーザー |
tsuishi
|
| 提出日時 | 2020-12-29 15:19:11 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 13 ms / 2,000 ms |
| コード長 | 1,268 bytes |
| コンパイル時間 | 215 ms |
| コンパイル使用メモリ | 30,464 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-05 15:25:03 |
| 合計ジャッジ時間 | 2,364 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 31 |
ソースコード
#include <stdio.h>
#define DEBUGe
#define NOP do{}while(0)
#ifdef DEBUG
#define TRACE(...) do{printf(__VA_ARGS__);fflush(stdout);}while(0)
#define TRACECR do{printf("\n");fflush(stdout);}while(0)
#else
#define TRACE(...) NOP
#define TRACECR NOP
#endif
#define REP(a,b) for(int a=0;a<(b);++a)
int main( void ) {
int m,n;
int x;
int y;
char c;
int map[201][201];
scanf("%d %d", &m, &n );
x = 0;
y = m;
REP(j,m+1) {
REP(i,m+1) {
map[j][i] = 1;
}
}
map[y][x] = 0;
REP(i,n) {
while( (c = fgetc(stdin)) == '\n' );
switch( c ) {
case 'U':
y--;
map[y][x] = 0;
break;
case 'D':
y++;
map[y][x] = 0;
break;
case 'L':
x--;
map[y][x] = 0;
break;
case 'R':
x++;
map[y][x] = 0;
break;
default:
printf("ERR[%c]\n",c);
return 1;
}
}
REP(j,m+1) {
REP(i,m+1) {
if(i) printf(" ");
printf("%d",map[j][i]);
}
printf("\n");
}
return 0;
}
tsuishi