結果
問題 |
No.2828 Remainder Game
|
ユーザー |
|
提出日時 | 2024-08-02 21:44:19 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 715 bytes |
コンパイル時間 | 1,990 ms |
コンパイル使用メモリ | 196,804 KB |
最終ジャッジ日時 | 2025-02-23 19:56:59 |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 7 WA * 13 |
ソースコード
#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,int all) -> 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,c); } int c2 = all-c; if(c2){ if(M > N) answer += now.at(1)*c2; else check(check,{now.at(1),now.at(1)+M},M+M,c2); } }; check(check,{0,1},2,5); cout << "0 1" << endl; cout << answer << endl; }