結果

問題 No.331 CodeRunnerでやれ
ユーザー chocoruskchocorusk
提出日時 2018-12-11 02:03:34
言語 C++11
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 1,609 bytes
コンパイル時間 774 ms
コンパイル使用メモリ 95,316 KB
実行使用メモリ 24,472 KB
平均クエリ数 627.47
最終ジャッジ日時 2023-09-23 16:37:25
合計ジャッジ時間 8,274 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 153 ms
23,352 KB
testcase_01 AC 133 ms
23,364 KB
testcase_02 AC 156 ms
23,980 KB
testcase_03 RE -
testcase_04 AC 158 ms
23,340 KB
testcase_05 AC 157 ms
23,388 KB
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 AC 260 ms
23,992 KB
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <string>
#include <iostream>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
bool e;
bool used[50][50];
void dfs(int x, int y){
	used[x][y]=1;
	int d;
	cin>>d;
	if(d==20151224){
		while(1){
			cout<<"F"<<endl;
			string s;
			cin>>s;
			if(s=="Merry"){
				cin>>s;
			    e=1;
			    return;
			}
		}
	}
	if(d && !used[x+1][y]){
		cout<<"F"<<endl;
		dfs(x+1, y);
		if(e) return;
		cout<<"B"<<endl;
		cin>>d;
	}
	cout<<"L"<<endl;
	cin>>d;
	if(d==20151224){
		while(1){
			cout<<"F"<<endl;
			string s;
			cin>>s;
			if(s=="Merry"){
				cin>>s;
			    e=1;
			    return;
			}
		}
	}
	if(d && !used[x][y+1]){
		cout<<"F"<<endl;
		dfs(x, y+1);
		if(e) return;
		cout<<"B"<<endl;
		cin>>d;
	}
	cout<<"L"<<endl;
	cin>>d;
	if(d==20151224){
		while(1){
			cout<<"F"<<endl;
			string s;
			cin>>s;
			if(s=="Merry"){
				cin>>s;
			    e=1;
			    return;
			}
		}
	}
	if(d && !used[x-1][y]){
		cout<<"F"<<endl;
		dfs(x-1, y);
		if(e) return;
		cout<<"B"<<endl;
		cin>>d;
	}
	cout<<"L"<<endl;
	cin>>d;
	if(d==20151224){
		while(1){
			cout<<"F"<<endl;
			string s;
			cin>>s;
			if(s=="Merry"){
				cin>>s;
			    e=1;
			    return;
			}
		}
	}
	if(d && !used[x][y-1]){
		cout<<"F"<<endl;
		dfs(x, y-1);
		if(e) return;
		cout<<"B"<<endl;
		cin>>d;
	}
	cout<<"L"<<endl;
	cin>>d;
}
int main()
{
	dfs(21, 21);
	return 0;
}
0