結果

問題 No.2828 Remainder Game
ユーザー InTheBloom
提出日時 2024-08-02 21:50:45
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 91 ms / 2,000 ms
コード長 896 bytes
コンパイル時間 828 ms
コンパイル使用メモリ 86,064 KB
実行使用メモリ 25,208 KB
平均クエリ数 42.00
最終ジャッジ日時 2024-08-02 21:50:50
合計ジャッジ時間 4,003 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#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