結果
| 問題 |
No.331 CodeRunnerでやれ
|
| コンテスト | |
| ユーザー |
lunnear
|
| 提出日時 | 2019-01-21 04:49:34 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,442 bytes |
| コンパイル時間 | 174 ms |
| コンパイル使用メモリ | 24,448 KB |
| 実行使用メモリ | 96,868 KB |
| 平均クエリ数 | 62.88 |
| 最終ジャッジ日時 | 2024-07-16 16:36:18 |
| 合計ジャッジ時間 | 9,098 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 7 TLE * 1 -- * 8 |
ソースコード
#include <stdio.h>
#include <stdlib.h>
int main()
{
enum Mode
{
First,
CheckL,
Rotate,
};
char ins[20];
int in;
Mode mode = First;
while(1)
{
scanf("%s", ins);
if(ins[0] == 'M')
break;
in = atoi(ins);
// 直進でゴール!
if(in > 20)
{
printf("F\n");
fflush(0);
continue;
}
switch(mode)
{
case First: // 最初は壁に当たるまで直進
{
if(in == 0)
{
printf("R\n");
mode = Rotate;
}
else
{
printf("F\n");
}
fflush(0);
break;
}
case CheckL: // 左向く
{
printf("L\n");
fflush(0);
mode = Rotate;
break;
}
case Rotate: // 回って進む
{
if(in == 0)
{
printf("R\n");
fflush(0);
}
else
{
printf("F\n");
fflush(0);
mode = CheckL;
}
break;
}
default:;
}
}
return 0;
}
lunnear