結果

問題 No.2828 Remainder Game
ユーザー GOTKAKO
提出日時 2024-08-02 21:30:13
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 766 bytes
コンパイル時間 1,916 ms
コンパイル使用メモリ 195,500 KB
最終ジャッジ日時 2025-02-23 19:52:17
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 5 WA * 15
権限があれば一括ダウンロードができます

ソースコード

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