結果

問題 No.2828 Remainder Game
コンテスト
ユーザー InTheBloom
提出日時 2024-08-02 21:50:45
言語 C++23
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 84 ms / 2,000 ms
コード長 896 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,415 ms
コンパイル使用メモリ 162,444 KB
実行使用メモリ 30,212 KB
平均クエリ数 42.00
最終ジャッジ日時 2026-04-03 19:35:05
合計ジャッジ時間 3,758 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge4_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
#include <vector>
#include <string>

using namespace std;

int main () {
    int N; cin >> N;

    // 2進数のbitごとに特定していけばよさそう。

    int S = 0;

    int M = 2;
    for (int i = 0; i < 10; i++) {
        { // ibit目が0
            cout << M << " " << M / 2 << "\n";
            for (int v = 0; v < M / 2; v++) {
                cout << v << (v == M / 2 - 1 ? "\n" : " ");
            }
            cout << flush;
            int C; cin >> C;
        }

        { // ibit目が1
            cout << M << " " << M / 2 << "\n";
            for (int v = M / 2; v < M; v++) {
                cout << v << (v == M - 1 ? "\n" : " ");
            }
            cout << flush;
            int C; cin >> C;

            S += C * (1 << i);
        }

        M *= 2;
    }

    cout << 0 << " " << 1 << "\n";
    cout << S << "\n";
    cout << flush;
}
0