結果
| 問題 | No.934 Explosive energy drink | 
| コンテスト | |
| ユーザー |  yk356 | 
| 提出日時 | 2019-11-30 22:49:41 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 350 ms / 2,000 ms | 
| コード長 | 689 bytes | 
| コンパイル時間 | 2,237 ms | 
| コンパイル使用メモリ | 171,260 KB | 
| 実行使用メモリ | 25,220 KB | 
| 平均クエリ数 | 709.58 | 
| 最終ジャッジ日時 | 2024-07-16 18:59:08 | 
| 合計ジャッジ時間 | 6,244 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 24 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
    int N; cin>>N;
    vector<bool> flag(N);
    for(int i=1;i<=N;i++){
        cout<<"? "<<N-1<<endl;
        for(int j=1;j<=N;j++){
            if(i!=j){
                if(i!=N&&j==N) cout<<j<<endl;
                else if(i==N&&j==N-1) cout<<j<<endl;
                else cout<<j<<" ";
            }
        }
        bool ans; cin>>ans;
        flag[i-1]=ans;
    }
    vector<int> ansv;
    for(int i=0;i<N;i++) if(flag[i]==false) ansv.emplace_back(i+1);
    cout << "! " << ansv.size() << endl;
    for(int i=0;i<ansv.size();i++){
        if(i==N) cout<<ansv[i]<<endl;
        else cout<<ansv[i]<<" ";
    }
    return 0;
}
            
            
            
        