結果

問題 No.331 CodeRunnerでやれ
ユーザー FF256grhyFF256grhy
提出日時 2015-12-25 08:25:37
言語 C++11
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 596 bytes
コンパイル時間 258 ms
コンパイル使用メモリ 25,760 KB
実行使用メモリ 24,432 KB
平均クエリ数 5817.18
最終ジャッジ日時 2023-09-23 08:38:04
合計ジャッジ時間 12,463 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 157 ms
24,420 KB
testcase_01 RE -
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 -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

#define FSM fflush(stdout); scanf("%c", c); if(c[0] == 'M') { return 1; }
#define R printf("R\n"); FSM r = (r + 1) % 4;
#define L printf("L\n"); FSM r = (r + 3) % 4;
#define F printf("F\n"); FSM x += dx[r]; y += dy[r];

int f[38][38], x, y, r;
int dx[4] = { 1, 0, -1,  0 };
int dy[4] = { 0, 1,  0, -1 };
char c[17];

int p(void) {
	f[x][y] = 1;
	R
	
	int i;
	for(i = 0; i < 3; i++) {
		if(c[0] != 0 && f[ x + dx[r] ][ y + dy[r] ] == 0) {
			F
			if( p() ) { return 1; }
			R
		} else {
			L
		}
	}
	
	F
	
	return 0;
}

int main(void) {
	int n;
	x = y = 19;
	p();
	return 0;
}
0