結果
問題 |
No.2828 Remainder Game
|
ユーザー |
|
提出日時 | 2024-08-03 11:24:24 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 74 ms / 2,000 ms |
コード長 | 394 bytes |
コンパイル時間 | 723 ms |
コンパイル使用メモリ | 67,844 KB |
最終ジャッジ日時 | 2025-02-23 20:46:16 |
ジャッジサーバーID (参考情報) |
judge4 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
#include <iostream> using namespace std; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int N, sum = 0, i, M, R, C; cin >> N; for (M = 2, R = 1; M / 2 <= N; M *= 2) { cout << M << ' ' << M / 2 << '\n' << R; for (++R; R != M; ++R) cout << ' ' << R; cout << '\n' << flush; cin >> C; sum += M / 2 * C; } cout << "0 1\n" << sum << '\n' << flush; return 0; }