結果

問題 No.331 CodeRunnerでやれ
コンテスト
ユーザー chocorusk
提出日時 2018-12-11 02:03:34
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
RE  
実行時間 -
コード長 1,609 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 626 ms
コンパイル使用メモリ 126,752 KB
実行使用メモリ 29,012 KB
平均クエリ数 635.24
最終ジャッジ日時 2026-03-31 05:53:31
合計ジャッジ時間 5,773 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 5 RE * 11
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#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