結果

問題 No.934 Explosive energy drink
ユーザー hiro71687khiro71687k
提出日時 2023-04-16 17:48:46
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,158 bytes
コンパイル時間 4,906 ms
コンパイル使用メモリ 257,756 KB
実行使用メモリ 25,476 KB
平均クエリ数 709.54
最終ジャッジ日時 2024-04-20 06:09:42
合計ジャッジ時間 8,348 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 21 ms
24,812 KB
testcase_01 AC 173 ms
24,580 KB
testcase_02 AC 21 ms
24,964 KB
testcase_03 AC 97 ms
25,220 KB
testcase_04 AC 304 ms
24,964 KB
testcase_05 WA -
testcase_06 AC 20 ms
25,220 KB
testcase_07 AC 19 ms
24,964 KB
testcase_08 AC 19 ms
24,836 KB
testcase_09 AC 19 ms
24,824 KB
testcase_10 AC 19 ms
25,476 KB
testcase_11 AC 23 ms
25,208 KB
testcase_12 AC 23 ms
25,220 KB
testcase_13 AC 23 ms
24,964 KB
testcase_14 AC 26 ms
25,220 KB
testcase_15 AC 98 ms
24,964 KB
testcase_16 AC 33 ms
25,204 KB
testcase_17 AC 45 ms
24,580 KB
testcase_18 AC 48 ms
24,580 KB
testcase_19 AC 76 ms
24,964 KB
testcase_20 AC 135 ms
24,836 KB
testcase_21 AC 137 ms
25,220 KB
testcase_22 AC 196 ms
25,220 KB
testcase_23 AC 188 ms
24,836 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll=long long;
using ld=long double;
ld pie=3.141592653589793;
ll inf=1444999999;
ll mod=1000000007;
int main(){
    ll n;
    cin >> n;
    vector<ll>a,b;
    for (ll i = 0; i < n; i++)
    {
        a.push_back(i+1);
    }
    while (!a.empty())
    {
        ll x=a.size();
        x+=b.size();
        cout << "? " << x-1 << endl;
        vector<ll>c;
        for (ll i = 0; i < b.size(); i++)
        {
            c.push_back(b[i]);
        }
        ll aa=a.size();
        for (ll i = 0; i < aa-1; i++)
        {
            c.push_back(a[i]);
        }
        sort(c.begin(),c.end());
        for (ll i = 0; i < c.size(); i++)
        {
            cout << c[i] << ' ';
        }
        cout << endl;
        ll y;
        cin >> y;
        if (y==0)
        {
            b.push_back(a[a.size()-1]);
            a.pop_back();
        }else{
            a.pop_back();
        }
    }
    cout << "! " << b.size() << endl;
    sort(b.begin(),b.end());
    for (ll i = 0; i < b.size(); i++)
    {
        cout << b[i]<< ' ';
    }
    cout << endl;
}
0