結果
| 問題 | No.331 CodeRunnerでやれ |
| コンテスト | |
| ユーザー |
sugim48
|
| 提出日時 | 2015-12-24 01:05:39 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 1,642 bytes |
| 記録 | |
| コンパイル時間 | 904 ms |
| コンパイル使用メモリ | 95,708 KB |
| 実行使用メモリ | 25,616 KB |
| 平均クエリ数 | 720.59 |
| 最終ジャッジ日時 | 2024-07-16 08:16:04 |
| 合計ジャッジ時間 | 7,863 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 10 RE * 6 |
ソースコード
#define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
struct edge { int u, v; ll w; };
ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;
int dy[] = {0, -1, 0, 1};
int dx[] = {-1, 0, 1, 0};
string f() {
string s; cin >> s;
if (s == "Merry") exit(0);
return s;
}
void dfs(int y, int x, int k, vector<vector<bool> >& vis) {
vis[y][x] = true;
f();
cout << 'L' << endl; k = (k + 3) % 4;
if (f() != "0") {
int _y = y + dy[k], _x = x + dx[k];
if (!vis[_y][_x]) {
cout << 'F' << endl;
dfs(_y, _x, k, vis);
cout << 'B' << endl;
f();
}
}
cout << 'R' << endl; k = (k + 1) % 4;
if (f() != "0") {
int _y = y + dy[k], _x = x + dx[k];
if (!vis[_y][_x]) {
cout << 'F' << endl;
dfs(_y, _x, k, vis);
cout << 'B' << endl;
f();
}
}
cout << 'R' << endl; k = (k + 1) % 4;
if (f() != "0") {
int _y = y + dy[k], _x = x + dx[k];
if (!vis[_y][_x]) {
cout << 'F' << endl;
dfs(_y, _x, k, vis);
cout << 'B' << endl;
f();
}
}
}
int main() {
vector<vector<bool> > vis(50, vector<bool>(50));
for (;;) {
dfs(25, 25, 0, vis);
cout << 'R' << endl;
f();
}
}
sugim48