結果

問題 No.934 Explosive energy drink
ユーザー mamekinmamekin
提出日時 2019-11-30 12:39:30
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 315 ms / 2,000 ms
コード長 1,348 bytes
コンパイル時間 1,348 ms
コンパイル使用メモリ 117,032 KB
実行使用メモリ 24,288 KB
平均クエリ数 709.58
最終ジャッジ日時 2023-09-23 19:08:45
合計ジャッジ時間 6,332 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
24,000 KB
testcase_01 AC 311 ms
23,820 KB
testcase_02 AC 26 ms
23,652 KB
testcase_03 AC 160 ms
24,024 KB
testcase_04 AC 313 ms
24,288 KB
testcase_05 AC 26 ms
23,544 KB
testcase_06 AC 26 ms
23,364 KB
testcase_07 AC 26 ms
23,616 KB
testcase_08 AC 26 ms
24,276 KB
testcase_09 AC 26 ms
24,000 KB
testcase_10 AC 25 ms
23,808 KB
testcase_11 AC 26 ms
23,988 KB
testcase_12 AC 28 ms
23,628 KB
testcase_13 AC 31 ms
23,544 KB
testcase_14 AC 32 ms
23,652 KB
testcase_15 AC 105 ms
23,628 KB
testcase_16 AC 42 ms
23,376 KB
testcase_17 AC 64 ms
23,808 KB
testcase_18 AC 65 ms
24,048 KB
testcase_19 AC 122 ms
23,544 KB
testcase_20 AC 204 ms
23,388 KB
testcase_21 AC 218 ms
23,628 KB
testcase_22 AC 305 ms
23,400 KB
testcase_23 AC 315 ms
23,400 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <complex>
#include <string>
#include <vector>
#include <array>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
#include <iterator>
#include <memory>
#include <regex>
using namespace std;

int main()
{
    int n;
    cin >> n;

    vector<bool> ans(n);
    for(int i=0; i<n; ++i){
        cout << "? " << (n-1) << endl;
        bool isFirst = true;
        for(int j=0; j<n; ++j){
            if(i == j)
                continue;
            if(isFirst)
                isFirst = false;
            else
                cout << ' ';
            cout << (j+1);
        }
        cout << endl;

        int res;
        cin >> res;
        ans[i] = !(bool)res;
    }

    int cnt = 0;
    for(int i=0; i<n; ++i){
        if(ans[i])
            ++ cnt;
    }
    cout << "! " << cnt << endl;
    bool isFirst = true;
    for(int i=0; i<n; ++i){
        if(!ans[i])
            continue;
        if(isFirst)
            isFirst = false;
        else
            cout << ' ';
        cout << (i+1);
    }
    cout << endl;

    return 0;
}
0