結果

問題 No.331 CodeRunnerでやれ
ユーザー chocorusk
提出日時 2018-12-11 02:43:38
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 376 ms / 5,000 ms
コード長 933 bytes
コンパイル時間 1,051 ms
コンパイル使用メモリ 96,696 KB
実行使用メモリ 25,448 KB
平均クエリ数 399.88
最終ジャッジ日時 2024-07-17 02:03:49
合計ジャッジ時間 7,673 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 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];
int dx[4]={1, 0, -1, 0}, dy[4]={0, 1, 0, -1};
void dfs(int x, int y, int k){
used[x][y]=1;
int d;
cin>>d;
for(int i=0; i<4; i++){
if(d==20151224){
while(1){
cout<<"F"<<endl;
string s;
cin>>s;
if(s=="Merry"){
cin>>s;
e=1;
return;
}
}
}
if(d && !used[x+dx[(k+i)&3]][y+dy[(k+i)&3]]){
cout<<"F"<<endl;
dfs(x+dx[(k+i)&3], y+dy[(k+i)&3], (k+i)&3);
if(e) return;
cout<<"B"<<endl;
cin>>d;
}
cout<<"L"<<endl;
cin>>d;
}
}
int main()
{
dfs(21, 21, 0);
return 0;
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0