結果
| 問題 | No.934 Explosive energy drink | 
| コンテスト | |
| ユーザー |  NOSS | 
| 提出日時 | 2019-11-29 22:19:36 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 332 ms / 2,000 ms | 
| コード長 | 797 bytes | 
| コンパイル時間 | 979 ms | 
| コンパイル使用メモリ | 74,268 KB | 
| 実行使用メモリ | 25,476 KB | 
| 平均クエリ数 | 709.08 | 
| 最終ジャッジ日時 | 2024-07-16 18:35:13 | 
| 合計ジャッジ時間 | 4,834 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 24 | 
ソースコード
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
    int n;
    cin >> n;
    vector<int> ans;
    for(int i=1;i<=n;i++){
        vector<int> v = ans;
        for(int j=i+1;j<=n;j++){
            v.push_back(j);
        }
        if(v.size() < 2){
            ans.push_back(i);
            continue;
        }
        cout << "? " << v.size() << endl;
        for(int j=0;j<v.size();j++){
            if(j > 0) cout << " ";
            cout << v[j];
        }
        cout << endl;
        int res;
        cin >> res;
        if(res == 0) ans.push_back(i);
    }
    cout << "! " << ans.size() << endl;
    for(int i=0;i<ans.size();i++){
        if(i > 0) cout << " ";
        cout << ans[i];
    }
    cout << endl;
    return 0;
}
            
            
            
        