結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
23,532 KB
testcase_01 AC 163 ms
23,652 KB
testcase_02 AC 20 ms
24,036 KB
testcase_03 AC 91 ms
23,796 KB
testcase_04 AC 309 ms
23,532 KB
testcase_05 WA -
testcase_06 AC 20 ms
24,204 KB
testcase_07 AC 21 ms
23,964 KB
testcase_08 AC 21 ms
23,520 KB
testcase_09 AC 21 ms
23,676 KB
testcase_10 AC 22 ms
23,808 KB
testcase_11 AC 22 ms
24,048 KB
testcase_12 AC 24 ms
24,396 KB
testcase_13 AC 26 ms
23,628 KB
testcase_14 AC 26 ms
24,036 KB
testcase_15 AC 102 ms
23,532 KB
testcase_16 AC 31 ms
24,036 KB
testcase_17 AC 43 ms
24,012 KB
testcase_18 AC 46 ms
24,276 KB
testcase_19 AC 71 ms
24,180 KB
testcase_20 AC 117 ms
24,060 KB
testcase_21 AC 120 ms
23,652 KB
testcase_22 AC 164 ms
23,400 KB
testcase_23 AC 163 ms
23,376 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(){
    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