結果

問題 No.331 CodeRunnerでやれ
ユーザー kotatsugamekotatsugame
提出日時 2020-03-11 03:46:05
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 689 bytes
コンパイル時間 1,105 ms
コンパイル使用メモリ 66,284 KB
実行使用メモリ 24,592 KB
平均クエリ数 2891.24
最終ジャッジ日時 2023-09-23 20:45:15
合計ジャッジ時間 13,341 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
23,448 KB
testcase_01 AC 150 ms
23,448 KB
testcase_02 WA -
testcase_03 AC 309 ms
23,572 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 488 ms
23,376 KB
testcase_07 RE -
testcase_08 AC 1,410 ms
23,344 KB
testcase_09 AC 387 ms
23,596 KB
testcase_10 AC 369 ms
23,704 KB
testcase_11 RE -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
using namespace std;
int dx[4]={1,0,-1,0};
int dy[4]={0,-1,0,1};
bool vis[4][50][50];
void ending()
{
	while(true)
	{
		cout<<"F"<<endl;
		string s;
		cin>>s;
		if(s=="Merry")cin>>s,exit(0);
	}
}
void dfs(int x,int y,int r)
{
	int t;cin>>t;
	vis[r][x][y]=true;
	if(t==20151224)ending();
	if(t>0)
	{
		int tx=x+dx[r],ty=y+dy[r],tr=r;
		if(!vis[tr][tx][ty])
		{
			cout<<"F"<<endl;
			dfs(tx,ty,tr);
		}
	}
	for(int nr=1;nr<=4;nr++)
	{
		int tx=x,ty=y,tr=(r+nr)%4;
		cout<<"R"<<endl;
		cin>>t;
		if(t==20151224)ending();
		if(!vis[tr][tx][ty])
		{
			cout<<"F"<<endl;
			dfs(tx,ty,tr);
		}
	}
	cout<<"B"<<endl;
	cin>>t;
}
main()
{
	int nx=25,ny=25,nr=0;
	dfs(nx,ny,nr);
}
0