結果

問題 No.934 Explosive energy drink
ユーザー homesentinelhomesentinel
提出日時 2019-11-29 21:51:04
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 298 ms / 2,000 ms
コード長 2,018 bytes
コンパイル時間 1,080 ms
コンパイル使用メモリ 116,808 KB
実行使用メモリ 24,324 KB
平均クエリ数 709.58
最終ジャッジ日時 2023-09-23 18:22:56
合計ジャッジ時間 5,585 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
23,352 KB
testcase_01 AC 295 ms
23,352 KB
testcase_02 AC 24 ms
24,012 KB
testcase_03 AC 151 ms
23,532 KB
testcase_04 AC 294 ms
23,508 KB
testcase_05 AC 23 ms
24,276 KB
testcase_06 AC 24 ms
23,376 KB
testcase_07 AC 23 ms
24,000 KB
testcase_08 AC 23 ms
23,340 KB
testcase_09 AC 22 ms
23,304 KB
testcase_10 AC 24 ms
24,300 KB
testcase_11 AC 25 ms
23,328 KB
testcase_12 AC 26 ms
23,808 KB
testcase_13 AC 30 ms
23,580 KB
testcase_14 AC 29 ms
23,340 KB
testcase_15 AC 102 ms
24,288 KB
testcase_16 AC 42 ms
24,324 KB
testcase_17 AC 62 ms
23,952 KB
testcase_18 AC 64 ms
23,460 KB
testcase_19 AC 118 ms
23,616 KB
testcase_20 AC 195 ms
23,580 KB
testcase_21 AC 209 ms
23,976 KB
testcase_22 AC 290 ms
23,568 KB
testcase_23 AC 298 ms
23,592 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <climits>
#include <cstring>

#define rep(i, m, n) for(int i=int(m);i<int(n);i++)
#define all(c) begin(c),end(c)

template<typename T1, typename T2>
inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }

template<typename T1, typename T2>
inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }

typedef long long int ll;
using ll = long long int;
using ull = long long unsigned int;
using Int = long long int;
using namespace std;
#define INF (1 << 30) - 1
#define INFl (ll)5e15
#define DEBUG 0
#define dump(x)  cerr << #x << " = " << (x) << endl
#define MOD 1000000007


//edit
class Solve {
public:
    void solve() {
        Int N;
        cin >> N;
        vector<bool> not_bomb(N);

        for (int i = 0; i < N; ++i) {
            cout << "? " << N - 1 << endl;
            for (int j = 0; j < N; ++j) {
                if (i != j) cout << j + 1 << " ";
            }
            cout << endl;

            Int val;
            cin >> val;
            if (!val) {
                not_bomb[i] = true;
            }
        }

        vector<Int> ans;
        for (int i = 0; i < N; ++i) {
            if (not_bomb[i]) ans.push_back(i + 1);
        }

        cout << "! " << ans.size() << endl;
        for (auto e : ans) cout << e << " ";
        cout << endl;

    }
};


int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);

    Solve().solve();


    return 0;
}
0