結果
問題 | No.934 Explosive energy drink |
ユーザー |
![]() |
提出日時 | 2020-01-10 14:40:53 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 356 ms / 2,000 ms |
コード長 | 703 bytes |
コンパイル時間 | 1,987 ms |
コンパイル使用メモリ | 196,260 KB |
最終ジャッジ日時 | 2025-01-08 17:01:13 |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { int n; cin >> n; vector<bool> use(n + 1); int cnt = 0; for (int i = 1; i <= n; i++) { cout << "? " << n - 1 << endl; for (int j = 1; j <= n; j++) { if (i == j) continue; cout << j; if (j != n) cout << " "; else cout << endl; } int ans; cin >> ans; use.at(i) = 1 - ans; cnt += 1 - ans; } cout << "! " << cnt << endl; for (int i = 1; i <= n; i++) { if (use.at(i)) { cout << i; if (i != n) cout << " "; else cout << endl; } } }