結果

問題 No.331 CodeRunnerでやれ
ユーザー fine
提出日時 2016-04-04 00:53:14
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,373 bytes
コンパイル時間 1,370 ms
コンパイル使用メモリ 161,264 KB
実行使用メモリ 96,916 KB
平均クエリ数 16.88
最終ジャッジ日時 2024-07-16 23:31:12
合計ジャッジ時間 9,518 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 4 TLE * 1 -- * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    string a[2] = {"L","R"}, s;
    int t = 1, x, f = 0, c = 0;
    while (cin >> x) {
        if (x) {
            if (x > 20) {
                cout << "F" << endl;
                break;
            }
            if (f) {
                cout << a[1 - t] << endl;
                cin >> x;
                if (x > 20) {
                    cout << "F" << endl;
                    break;
                } else {
                    cout << a[t] << endl;
                    cin >> x;
                }
            }
            cout << "F" << endl;
        } else {
            if (f) {
                cout << a[1 - t] << endl;
                cin >> x;
                if (x > 20) {
                    cout << "F" << endl;
                    break;
                } else {
                    cout << a[t] << endl;
                    cin >> x;
                }
            }
            cout << a[t] << endl;
            if (c) {
                cin >> x;
                cout << a[t] << endl;
                c = 0;
            } else {
                c++;
            }
            f = 1;
        }          
    }
    while (cin >> s) {
        if (s[0] == 'M') break;
        else {
            cout << "F" << endl;
        }
    }
    return 0;
}
0