結果

問題 No.934 Explosive energy drink
ユーザー noisy_noiminnoisy_noimin
提出日時 2019-11-29 22:10:37
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 303 ms / 2,000 ms
コード長 1,171 bytes
コンパイル時間 948 ms
コンパイル使用メモリ 96,248 KB
実行使用メモリ 24,288 KB
平均クエリ数 709.58
最終ジャッジ日時 2023-09-23 18:33:29
合計ジャッジ時間 5,734 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
23,376 KB
testcase_01 AC 303 ms
23,556 KB
testcase_02 AC 25 ms
24,048 KB
testcase_03 AC 152 ms
24,288 KB
testcase_04 AC 296 ms
24,288 KB
testcase_05 AC 26 ms
23,964 KB
testcase_06 AC 25 ms
23,688 KB
testcase_07 AC 25 ms
23,484 KB
testcase_08 AC 25 ms
23,964 KB
testcase_09 AC 25 ms
24,000 KB
testcase_10 AC 24 ms
23,616 KB
testcase_11 AC 25 ms
23,376 KB
testcase_12 AC 25 ms
24,048 KB
testcase_13 AC 29 ms
24,288 KB
testcase_14 AC 30 ms
23,376 KB
testcase_15 AC 100 ms
23,400 KB
testcase_16 AC 43 ms
24,048 KB
testcase_17 AC 62 ms
23,616 KB
testcase_18 AC 66 ms
23,580 KB
testcase_19 AC 118 ms
23,844 KB
testcase_20 AC 194 ms
23,364 KB
testcase_21 AC 212 ms
23,964 KB
testcase_22 AC 293 ms
24,288 KB
testcase_23 AC 298 ms
23,652 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <tuple>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cassert>
#include <cstdint>
#include <numeric>
#include <bitset>
#include <functional>

using namespace std;

using ll =  long long;
using Pll = pair<ll, ll>;
using Pii = pair<int, int>;

constexpr ll MOD = 1000000007;
constexpr long double EPS = 1e-10;
constexpr int dyx[4][2] = {
    { 0, 1}, {-1, 0}, {0,-1}, {1, 0}
};

int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    int n, ans;
    cin >> n;

    vector<int> a;
    int cnt = 0;
    for(int i=0;i<n;++i) {
        cout << "? " << n-1 << endl;
        cout << ((i==0)?2:1);
        for(int j=((i==0)?2:1);j<n;++j) {
            if(i != j) {
                cout << " " << j+1;
            }
        }
        cout << endl;
        cin >> ans;
        if(ans == 0) a.push_back(i);
        cnt += 1-ans;
    }

    cout << "! " << cnt << endl;
    cout << a[0]+1;
    for(int i=1;i<a.size();++i) cout << " " << a[i]+1;
    cout << endl;
}
0