結果
問題 |
No.3120 Lower Nim
|
ユーザー |
|
提出日時 | 2025-04-17 11:53:59 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 1,183 bytes |
コンパイル時間 | 10,195 ms |
コンパイル使用メモリ | 351,772 KB |
実行使用メモリ | 26,552 KB |
平均クエリ数 | 4.66 |
最終ジャッジ日時 | 2025-04-17 11:54:18 |
合計ジャッジ時間 | 17,859 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 1 |
other | WA * 6 RE * 37 |
ソースコード
#include "testlib.h" #include <bits/stdc++.h> using namespace std; using ll = long long; const ll min_n = 1; const ll max_n = 40; const ll min_a = 1; const ll max_a = 10000; const ll min_sum = 1; const ll max_sum = 10000; int main(){ registerValidation(); ll n = inf.readInt(min_n, max_n); inf.readEoln(); vector<ll> a(n); ll sum = 0; for (ll i = 0; i < n; i++){ a[i] = inf.readInt(min_a, max_a); sum += a[i]; if (i != n - 1) inf.readSpace(); } inf.readEoln(); cout << "First" << endl; while(true){ for(int i = 0; i < n; i++) { if(a[i] != 0) { cout << i + 1 << " " << 1 << endl; break; } } int res = inf.readInt(-1, 1); inf.readEoln(); if(res == -1 || res == 1) { break; } int i = inf.readInt(1, n) - 1; inf.readSpace(); int x = inf.readInt(1, 1); inf.readEoln(); assert(a[i] >= x); a[i] -= x; res = inf.readInt(-1, 1); inf.readEoln(); if(res == -1 || res == 1) { break; } } inf.readEof(); }