結果
問題 | No.934 Explosive energy drink |
ユーザー |
|
提出日時 | 2019-11-29 22:49:09 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 327 ms / 2,000 ms |
コード長 | 624 bytes |
コンパイル時間 | 1,502 ms |
コンパイル使用メモリ | 168,804 KB |
実行使用メモリ | 25,476 KB |
平均クエリ数 | 709.08 |
最終ジャッジ日時 | 2024-07-16 18:43:05 |
合計ジャッジ時間 | 5,428 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 |
ソースコード
#include "bits/stdc++.h" #define rep(i,n) for(int i=0;i<n;i++) using namespace std; using ll = long long; int main() { int N, K, ans; cin >> N; K = N; vector<bool> f(N, false); rep(i, N) { cout << "? " << K - 1 << endl; rep(j, N) { if (i == j || f[j]) continue; cout << j + 1 << " "; } cout << endl; cin >> ans; if (ans == 1) { f[i] = true; K--; if (K == 2) break; } } cout << "! " << K << endl; rep(i, N) { if (!f[i]) cout << i + 1 << " "; } cout << endl; }