結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
24,408 KB
testcase_01 AC 172 ms
23,652 KB
testcase_02 AC 21 ms
23,520 KB
testcase_03 AC 95 ms
23,412 KB
testcase_04 AC 330 ms
23,796 KB
testcase_05 WA -
testcase_06 AC 20 ms
23,820 KB
testcase_07 AC 20 ms
24,000 KB
testcase_08 AC 21 ms
23,628 KB
testcase_09 AC 19 ms
23,364 KB
testcase_10 AC 20 ms
23,640 KB
testcase_11 AC 21 ms
23,664 KB
testcase_12 AC 22 ms
23,796 KB
testcase_13 AC 24 ms
23,400 KB
testcase_14 AC 25 ms
23,784 KB
testcase_15 AC 106 ms
23,796 KB
testcase_16 AC 31 ms
24,012 KB
testcase_17 AC 43 ms
24,396 KB
testcase_18 AC 46 ms
23,400 KB
testcase_19 AC 73 ms
24,024 KB
testcase_20 AC 124 ms
23,448 KB
testcase_21 AC 121 ms
23,652 KB
testcase_22 AC 171 ms
23,424 KB
testcase_23 AC 178 ms
24,384 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