結果

問題 No.934 Explosive energy drink
ユーザー yk356yk356
提出日時 2019-11-30 22:49:41
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 325 ms / 2,000 ms
コード長 689 bytes
コンパイル時間 1,465 ms
コンパイル使用メモリ 168,868 KB
実行使用メモリ 24,360 KB
平均クエリ数 709.58
最終ジャッジ日時 2023-09-23 19:10:16
合計ジャッジ時間 6,288 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
23,532 KB
testcase_01 AC 320 ms
23,364 KB
testcase_02 AC 25 ms
23,820 KB
testcase_03 AC 163 ms
23,424 KB
testcase_04 AC 325 ms
23,640 KB
testcase_05 AC 24 ms
24,336 KB
testcase_06 AC 24 ms
24,024 KB
testcase_07 AC 23 ms
23,652 KB
testcase_08 AC 23 ms
24,012 KB
testcase_09 AC 24 ms
24,024 KB
testcase_10 AC 24 ms
23,544 KB
testcase_11 AC 26 ms
23,412 KB
testcase_12 AC 26 ms
23,352 KB
testcase_13 AC 30 ms
23,616 KB
testcase_14 AC 31 ms
24,360 KB
testcase_15 AC 106 ms
23,376 KB
testcase_16 AC 43 ms
23,832 KB
testcase_17 AC 65 ms
23,640 KB
testcase_18 AC 64 ms
23,520 KB
testcase_19 AC 123 ms
24,036 KB
testcase_20 AC 208 ms
23,628 KB
testcase_21 AC 227 ms
24,336 KB
testcase_22 AC 314 ms
23,544 KB
testcase_23 AC 323 ms
23,652 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
    int N; cin>>N;
    vector<bool> flag(N);
    for(int i=1;i<=N;i++){
        cout<<"? "<<N-1<<endl;
        for(int j=1;j<=N;j++){
            if(i!=j){
                if(i!=N&&j==N) cout<<j<<endl;
                else if(i==N&&j==N-1) cout<<j<<endl;
                else cout<<j<<" ";
            }
        }
        bool ans; cin>>ans;
        flag[i-1]=ans;
    }
    vector<int> ansv;
    for(int i=0;i<N;i++) if(flag[i]==false) ansv.emplace_back(i+1);
    cout << "! " << ansv.size() << endl;
    for(int i=0;i<ansv.size();i++){
        if(i==N) cout<<ansv[i]<<endl;
        else cout<<ansv[i]<<" ";
    }
    return 0;
}
0