結果

問題 No.331 CodeRunnerでやれ
ユーザー mayoko_
提出日時 2015-12-24 12:35:09
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,601 bytes
コンパイル時間 625 ms
コンパイル使用メモリ 86,076 KB
実行使用メモリ 98,716 KB
最終ジャッジ日時 2024-07-16 22:41:32
合計ジャッジ時間 13,602 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample -- * 1
other TLE * 1 -- * 15
権限があれば一括ダウンロードができます

ソースコード

diff #
プレゼンテーションモードにする

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
//#include<cctype>
#include<climits>
#include<iostream>
#include<string>
#include<vector>
#include<map>
//#include<list>
#include<queue>
#include<deque>
#include<algorithm>
//#include<numeric>
#include<utility>
#include<complex>
//#include<memory>
#include<functional>
#include<cassert>
#include<set>
#include<stack>
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pii;
bool visit[50][50];
const int B = 25;
int dir = 0;
void dfs(int y, int x) {
visit[y][x] = true;
int odir = dir;
string s;
for (int k = 0; k < 4; k++) {
cout << "L" << endl;
dir = (dir+1)%4;
int f;
cin >> f;
if (f != 0) {
if (f == 20151224) {
s = "1";
while (isdigit(s[0])) {
cout << "F" << endl;
cin >> s;
}
exit(0);
}
int ny = y+dy[(odir+k)%4];
int nx = x+dx[(odir+k)%4];
if (visit[ny+B][nx+B]) continue;
cout << "F" << endl;
cin >> s;
dfs(ny, nx);
while (dir != (odir+k)%4) {
cout << "L" << endl;
cin >> s;
dir = (dir+1)%4;
}
}
}
while (dir != (odir+2)%4) {
cout << "L" << endl;
dir = (dir+1)%4;
cin >> s;
}
}
int main() {
dfs(0, 0);
return 0;
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0