結果
問題 |
No.934 Explosive energy drink
|
ユーザー |
![]() |
提出日時 | 2020-03-21 19:55:30 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 354 ms / 2,000 ms |
コード長 | 608 bytes |
コンパイル時間 | 1,647 ms |
コンパイル使用メモリ | 167,156 KB |
実行使用メモリ | 25,604 KB |
平均クエリ数 | 709.58 |
最終ジャッジ日時 | 2024-07-17 03:20:59 |
合計ジャッジ時間 | 6,502 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 |
ソースコード
#include <bits/stdc++.h> using namespace std; bool ans[1010]; int main() { int n; cin >> n; int k = 0; for(int i = 1; i <= n; ++i) { cout << "? " << n - 1 << '\n'; bool f = true; for(int j = 1; j <= n; ++j) { if(f and j != i) { cout << j; f = false; } else if(j != i) { cout << " " << j; } } cout << '\n'; cout.flush(); cin >> ans[i]; if(not ans[i]) ++k; } cout << "! " << k << '\n'; bool f = true; for(int j = 1; j <= n; ++j) { if(f and not ans[j]) { cout << j; f = false; } else if(not ans[j]) { cout << " " << j; } } cout << '\n'; return 0; }