結果

問題 No.2828 Remainder Game
ユーザー GOTKAKOGOTKAKO
提出日時 2024-08-02 21:30:13
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 766 bytes
コンパイル時間 2,256 ms
コンパイル使用メモリ 203,540 KB
実行使用メモリ 25,464 KB
平均クエリ数 1506.40
最終ジャッジ日時 2024-08-02 21:30:18
合計ジャッジ時間 5,279 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 63 ms
24,952 KB
testcase_16 AC 61 ms
25,208 KB
testcase_17 AC 60 ms
24,568 KB
testcase_18 AC 63 ms
24,952 KB
testcase_19 AC 67 ms
24,824 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int N; cin >> N;
    int answer = 0;
    auto check = [&](auto check,vector<int> now,int M) -> void {
        cout << M << " " << 1 << endl;
        cout << now.at(0) << endl;
        int c; cin >> c;
        if(c){
            if(M > N) answer += now.at(0)*c;
            else check(check,{now.at(0),now.at(0)+M},M+M);
        }
        cout << M << " " << 1 << endl;
        cout << now.at(1) << endl;
        cin >> c;
        if(c){
            if(M > N) answer += now.at(1)*c;
            else check(check,{now.at(1),now.at(1)+M},M+M);
        }
    };

    check(check,{0,1},2);
    cout << "0 1" << endl;
    cout << answer << endl;
}
0