結果
| 問題 |
No.934 Explosive energy drink
|
| コンテスト | |
| ユーザー |
risujiroh
|
| 提出日時 | 2019-11-29 21:57:35 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 318 ms / 2,000 ms |
| コード長 | 582 bytes |
| コンパイル時間 | 1,786 ms |
| コンパイル使用メモリ | 168,768 KB |
| 実行使用メモリ | 25,476 KB |
| 平均クエリ数 | 709.58 |
| 最終ジャッジ日時 | 2024-07-16 18:20:27 |
| 合計ジャッジ時間 | 6,201 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 24 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> res;
for (int i = 0; i < n; ++i) {
cout << "? " << n - 1 << '\n';
bool f = true;
for (int j = 0; j < n; ++j) {
if (j != i) {
if (!f) {
cout << ' ';
}
f = false;
cout << j + 1;
}
}
cout << endl;
int ans;
cin >> ans;
if (ans == 0) {
res.push_back(i);
}
}
int k = res.size();
cout << "! " << k << '\n';
for (int i = 0; i < k; ++i) {
cout << res[i] + 1 << " \n"[i == k - 1];
}
}
risujiroh