結果

問題 No.331 CodeRunnerでやれ
ユーザー chocorusk
提出日時 2018-12-11 01:45:20
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
TLE  
実行時間 -
コード長 1,423 bytes
コンパイル時間 794 ms
コンパイル使用メモリ 98,780 KB
実行使用メモリ 79,528 KB
最終ジャッジ日時 2024-07-16 16:29:09
合計ジャッジ時間 13,904 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample -- * 1
other TLE * 1 -- * 15
権限があれば一括ダウンロードができます

ソースコード

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 end;
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!") return;
		}
	}
	if(!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!") return;
		}
	}
	if(!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!") return;
		}
	}
	if(!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!") return;
		}
	}
	if(!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