結果
問題 | No.934 Explosive energy drink |
ユーザー |
|
提出日時 | 2019-11-30 14:17:11 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 373 ms / 2,000 ms |
コード長 | 607 bytes |
コンパイル時間 | 2,129 ms |
コンパイル使用メモリ | 194,904 KB |
最終ジャッジ日時 | 2025-01-08 06:27:32 |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); int N; cin >> N; auto query = [N](int v) { cout << "? " << N - 1 << endl; for (int i = 0; i < N; ++i) { if (i == v) continue; cout << i + 1 << " "; } cout << endl; int res; cin >> res; return res; }; vector<int> need; for (int i = 0; i < N; ++i) { if (!query(i)) { need.push_back(i); } } cout << "! " << need.size() << endl; for (int i = 0; i < need.size(); ++i) { cout << need[i] + 1 << " \n"[i + 1 == need.size()]; } return 0; }