結果
問題 | No.934 Explosive energy drink |
ユーザー | 東前頭十一枚目 |
提出日時 | 2020-03-21 19:55:30 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 304 ms / 2,000 ms |
コード長 | 608 bytes |
コンパイル時間 | 1,555 ms |
コンパイル使用メモリ | 165,108 KB |
実行使用メモリ | 24,432 KB |
平均クエリ数 | 709.58 |
最終ジャッジ日時 | 2023-09-24 03:13:26 |
合計ジャッジ時間 | 5,865 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 24 ms
23,868 KB |
testcase_01 | AC | 292 ms
23,556 KB |
testcase_02 | AC | 21 ms
24,216 KB |
testcase_03 | AC | 151 ms
23,544 KB |
testcase_04 | AC | 304 ms
24,180 KB |
testcase_05 | AC | 22 ms
24,228 KB |
testcase_06 | AC | 21 ms
24,084 KB |
testcase_07 | AC | 21 ms
23,688 KB |
testcase_08 | AC | 20 ms
23,664 KB |
testcase_09 | AC | 21 ms
24,432 KB |
testcase_10 | AC | 21 ms
23,544 KB |
testcase_11 | AC | 21 ms
23,676 KB |
testcase_12 | AC | 22 ms
23,472 KB |
testcase_13 | AC | 24 ms
23,472 KB |
testcase_14 | AC | 25 ms
23,388 KB |
testcase_15 | AC | 95 ms
24,228 KB |
testcase_16 | AC | 36 ms
23,676 KB |
testcase_17 | AC | 56 ms
23,448 KB |
testcase_18 | AC | 57 ms
23,676 KB |
testcase_19 | AC | 111 ms
23,664 KB |
testcase_20 | AC | 191 ms
23,556 KB |
testcase_21 | AC | 202 ms
23,844 KB |
testcase_22 | AC | 290 ms
23,880 KB |
testcase_23 | AC | 302 ms
23,568 KB |
ソースコード
#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; }