結果

問題 No.934 Explosive energy drink
ユーザー ShibuyapShibuyap
提出日時 2019-11-29 21:55:44
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 321 ms / 2,000 ms
コード長 1,103 bytes
コンパイル時間 1,882 ms
コンパイル使用メモリ 164,552 KB
実行使用メモリ 24,264 KB
平均クエリ数 1061.38
最終ジャッジ日時 2023-09-23 18:25:12
合計ジャッジ時間 6,818 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
23,376 KB
testcase_01 AC 317 ms
23,604 KB
testcase_02 AC 27 ms
23,304 KB
testcase_03 AC 164 ms
24,012 KB
testcase_04 AC 321 ms
23,376 KB
testcase_05 AC 27 ms
23,604 KB
testcase_06 AC 27 ms
23,580 KB
testcase_07 AC 26 ms
23,412 KB
testcase_08 AC 27 ms
23,616 KB
testcase_09 AC 27 ms
23,988 KB
testcase_10 AC 27 ms
24,228 KB
testcase_11 AC 28 ms
23,340 KB
testcase_12 AC 28 ms
24,252 KB
testcase_13 AC 32 ms
24,264 KB
testcase_14 AC 34 ms
23,568 KB
testcase_15 AC 108 ms
23,628 KB
testcase_16 AC 48 ms
23,724 KB
testcase_17 AC 68 ms
23,412 KB
testcase_18 AC 68 ms
23,808 KB
testcase_19 AC 127 ms
23,340 KB
testcase_20 AC 208 ms
23,460 KB
testcase_21 AC 221 ms
23,580 KB
testcase_22 AC 312 ms
23,964 KB
testcase_23 AC 315 ms
23,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
#define yn {puts("Yes");}else{puts("No");}
#define MAX_N 200005

int main() {
    int n;
    cin >> n;
    int a[n+1] = {};
    int k = 0;
    srep(i,1,n+1){
        cout << "? " << n - 1 << endl;
        int cnt = 0;
        srep(j,1,n+1){
            if(j != i){
                cout << j;
                cnt++;
                if(j < n-1){
                    cout << ' ';
                }else{
                    cout << endl;
                }
            }
        }
        fflush(stdout);
        int x; cin >> x;
        if(x == 0){
            a[i] = 1;
            k++;
        }
    }
    cout << "! " << k << endl;
    rep(i,n+1){
        if(a[i] == 1){
            cout << i;
            k--;
            if(k == 0){
                cout << endl;
            }else{
                cout << ' ';
            }
        }
    }
    return 0;
}
 
 
0