結果

問題 No.2828 Remainder Game
ユーザー Carpenters-Cat
提出日時 2024-08-02 22:24:11
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 111 ms / 2,000 ms
コード長 460 bytes
コンパイル時間 1,783 ms
コンパイル使用メモリ 196,380 KB
最終ジャッジ日時 2025-02-23 20:08:38
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main () {
	int N;
	cin >> N;
	int M = N + 1;
	int ans = 0;
	for (int i = 0; (1 << i) < M; i++) {
		std::vector<int> X;
		for (int j = 0; j < M; j ++) {
			if ((j >> i) & 1) {
				X.push_back(j);
			}
		}
		cout << M << " " << X.size() << endl;
		for (auto& a : X) {
			cout << a << (a == X.back() ? "" : " ");
		}
		cout<< endl;
		int x;
		cin >> x;
		ans += (1 << i) * x;
	}
	cout << "0 1\n" << ans << endl;
}
0