結果

問題 No.331 CodeRunnerでやれ
ユーザー chocoruskchocorusk
提出日時 2018-12-11 01:52:02
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 1,601 bytes
コンパイル時間 1,121 ms
コンパイル使用メモリ 94,716 KB
実行使用メモリ 78,712 KB
最終ジャッジ日時 2023-09-23 16:36:59
合計ジャッジ時間 13,878 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
権限があれば一括ダウンロードができます

ソースコード

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 Christmas!"){
			    e=1;
			    return;
			}
		}
	}
	if(e) return;
	if(d && !used[x+1][y]){
		cout<<"F"<<endl;
		dfs(x+1, y);
		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 Christmas!"){
			    e=1;
			    return;
			}
		}
	}
	if(e) return;
	if(d && !used[x][y+1]){
		cout<<"F"<<endl;
		dfs(x, y+1);
		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 Christmas!"){
			    e=1;
			    return;
			}
		}
	}
	if(e) return;
	if(d && !used[x-1][y]){
		cout<<"F"<<endl;
		dfs(x-1, y);
		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 Christmas!"){
			    e=1;
			    return;
			}
		}
	}
	if(e) return;
	if(d && !used[x][y-1]){
		cout<<"F"<<endl;
		dfs(x, y-1);
		cout<<"B"<<endl;
		cin>>d;
	}
	cout<<"L"<<endl;
	cin>>d;
}
int main()
{
	dfs(21, 21);
	return 0;
}
0