結果

問題 No.331 CodeRunnerでやれ
ユーザー 小指が強い人小指が強い人
提出日時 2016-02-12 04:15:25
言語 C++11
(gcc 11.4.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 2,539 bytes
コンパイル時間 1,371 ms
コンパイル使用メモリ 151,640 KB
実行使用メモリ 84,440 KB
最終ジャッジ日時 2023-09-23 23:09:50
合計ジャッジ時間 14,534 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> veci;
typedef vector<string> vecs;
template<class T,class U> using Hash=unordered_map<T,U>;

#define REP(i, a, n) for(ll i = a; i < n; i++)
#define RREP(i, a, n) for(ll i = n-1; i >= 0; i--)
#define rep(i, n) REP(i, 0, n)
#define rrep(i, n) RREP(i, 0, n)
#define MD 1000000007

template<class T> T read(){T a;cin >> a;return a;}
template<class T> T read(T& a){cin >> a;}
template<class T> void rarr(T a, int n){for(int i = 0; i < n; i++) {cin >> a[i];}}
template<class T> void write(T a){cout << a << endl;}
template<class T> void writes(vector<T> a, char* c = " "){cout << a[0];for(int i = 1; i < a.size(); i++)cout << c << a[i];cout << endl;;}
void write(double a){cout << fixed << setprecision(12) << a << endl;}
template<class T> void warr(T a, int n, char* c = " "){cout << a[0];for(int i = 1; i < n; i++)cout << c << a[i];cout << endl;}
void split(string s, string delim, veci& result){result.clear();string::size_type pos = 0;while(pos != string::npos){string::size_type p = s.find(delim, pos);if(p == string::npos){result.push_back(atoi(s.substr(pos).data()));break;}else {result.push_back(atoi(s.substr(pos, p - pos).data()));}pos = p + delim.size();}}
void split(string s, string delim, vecs& result){result.clear();string::size_type pos = 0;while(pos != string::npos){string::size_type p = s.find(delim, pos);if(p == string::npos){result.push_back(s.substr(pos));break;}else {result.push_back(s.substr(pos, p - pos));}pos = p + delim.size();}}
ll gcd(ll a, ll b){while(true){ll k = a % b;if(k == 0)return b;a = b;b = k;}}
ll comb(ll n, ll m){ll p=1;m=min(m,n-m);for(ll i=1;i<=m;i++){p*=n-i+1;p/=i;}return p;}
int a[60][60]={0};
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
bool solve(int x,int y, int d){
    a[x][y]=1;
    int n=read<int>();
    if(n>30)return true;
    rep(i,4){
        d=(d+i)%4;
        int xx=x+dx[d];
        int yy=y+dy[d];
        if(n==0)a[x+dx[d]][y+dy[d]]=-1;
        if(a[xx][yy]!=0){
            cout<<"R"<<endl;cout.flush();
            n=read<int>();
            continue;
        }
        cout<<"F"<<endl;cout.flush();
        if(solve(xx,yy,d))return true;
        cout<<"B"<<endl;cout.flush();
        read<int>();
        cout<<"R"<<endl;cout.flush();
        n=read<int>();
        if(n>30)return true;
    }
    return false;
}

int main(void)
{
    solve(30,30,0);
    while(read<string>()!="Merry Christmas!"){
        cout<<"F"<<endl;cout.flush();
    }
	return 0;
}
0