結果

問題 No.934 Explosive energy drink
ユーザー uchiiiiuchiiii
提出日時 2020-07-21 00:38:00
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,718 bytes
コンパイル時間 3,391 ms
コンパイル使用メモリ 220,888 KB
実行使用メモリ 24,408 KB
平均クエリ数 709.54
最終ジャッジ日時 2023-09-24 03:55:43
合計ジャッジ時間 7,282 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
24,300 KB
testcase_01 AC 169 ms
23,424 KB
testcase_02 AC 20 ms
24,036 KB
testcase_03 AC 92 ms
23,640 KB
testcase_04 AC 333 ms
23,664 KB
testcase_05 WA -
testcase_06 AC 21 ms
23,664 KB
testcase_07 AC 21 ms
23,952 KB
testcase_08 AC 20 ms
24,048 KB
testcase_09 AC 22 ms
23,544 KB
testcase_10 AC 21 ms
24,012 KB
testcase_11 AC 21 ms
23,352 KB
testcase_12 AC 22 ms
24,408 KB
testcase_13 AC 24 ms
23,652 KB
testcase_14 AC 26 ms
23,652 KB
testcase_15 AC 106 ms
24,336 KB
testcase_16 AC 31 ms
23,664 KB
testcase_17 AC 42 ms
24,192 KB
testcase_18 AC 48 ms
23,532 KB
testcase_19 AC 74 ms
23,544 KB
testcase_20 AC 122 ms
23,676 KB
testcase_21 AC 121 ms
23,364 KB
testcase_22 AC 184 ms
23,676 KB
testcase_23 AC 171 ms
23,664 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma region
#pragma GCC target("avx2")
#pragma GCC optimize("03")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std; typedef long double ld; typedef long long ll;
typedef unsigned long long ull;
#define endl "\n"
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define PII pair<int, int>
#define PLL pair<ll, ll>
#define VPII vector<PII>
#define VPLL vector<PLL>
#define ALL(x) (x).begin(), (x).end()
constexpr int INF=1<<30; constexpr ll LINF=1LL<<60; constexpr ll mod=1e9+7; constexpr int NIL = -1;
template<class T>inline bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>inline bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
#pragma endregion
//-------------------
vector<int> need;
vector<int> remained;

int main(){
    // cin.tie(0); ios::sync_with_stdio(false); //cout << fixed << setprecision(15);
    auto insert = [](vector<int>& v1, vector<int>& v2) {
        for(auto &e: v2) {
            v1.emplace_back(e);
        }
    };
    auto ask = [&]() {
        vector<int> v = remained;
        v.pop_back();
        insert(v, need);
        sort(v.begin(), v.end());
        cout << "? " << v.size() << endl;
        for(auto &e: v) cout << e << " ";
        cout << endl;
        int ans; cin >> ans;
        return ans;
    };
    int n; cin >> n;
    FOR(i,1,n) remained.emplace_back(i);

    while(remained.size() != 0) {
        int ans = ask();
        if(ans==0) {
            need.push_back(remained.back());
        } 
        remained.pop_back();        
    }

    sort(ALL(need));
    cout << "! " << need.size() << endl;
    for(auto &e: need) cout << e << " ";
    cout << endl;
    return 0;
}
0