結果
問題 |
No.2828 Remainder Game
|
ユーザー |
![]() |
提出日時 | 2024-08-02 22:09:08 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,126 bytes |
コンパイル時間 | 517 ms |
コンパイル使用メモリ | 67,496 KB |
実行使用メモリ | 25,216 KB |
平均クエリ数 | 22.90 |
最終ジャッジ日時 | 2024-08-02 22:09:14 |
合計ジャッジ時間 | 4,078 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 1 WA * 19 |
ソースコード
#include <iostream> typedef long long ll; const int MAXN = 2e5 + 5; using namespace std; int a[5], N, res, tmp; int main() { ios::sync_with_stdio(false); cin >> N; for (int i = 0; i <= 4; ++i) { cout << 5 << " " << 1 << endl; cout << i << endl; cin >> a[i]; } for (int i = 1; i <= N, a[1] > 0; i += 5) { cout << i << " " << 1 << endl; cout << 0 << endl; cin >> tmp; if (tmp) res += i * tmp; a[1] -= tmp; } for (int i = 2; i <= N, a[2] > 0; i += 5) { cout << i << " " << 1 << endl; cout << 0 << endl; cin >> tmp; if (tmp) res += i * tmp; a[2] -= tmp; } for (int i = 3; i <= N, a[3] > 0; i += 5) { cout << i << " " << 1 << endl; cout << 0 << endl; cin >> tmp; if (tmp) res += i * tmp; a[3] -= tmp; } for (int i = 4; i <= N, a[4] > 0; i += 5) { cout << i << " " << 1 << endl; cout << 0 << endl; cin >> tmp; if (tmp) res += i * tmp; a[4] -= tmp; } for (int i = 5; i <= N, a[0] > 0; i += 5) { cout << i << " " << 1 << endl; cout << 0 << endl; cin >> tmp; if (tmp) res += i * tmp; a[0] -= tmp; } cout << 0 << " " << 1 << endl; cout << res << endl; return 0; }