結果
問題 | No.934 Explosive energy drink |
ユーザー |
|
提出日時 | 2019-11-29 23:23:40 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 347 ms / 2,000 ms |
コード長 | 991 bytes |
コンパイル時間 | 1,115 ms |
コンパイル使用メモリ | 86,596 KB |
実行使用メモリ | 25,476 KB |
平均クエリ数 | 709.58 |
最終ジャッジ日時 | 2024-07-16 18:51:27 |
合計ジャッジ時間 | 5,826 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 |
ソースコード
#include<iostream> #include<string> #include<iomanip> #include<cmath> #include<vector> #include<algorithm> using namespace std; #define int long long #define endl "\n" constexpr long long INF = (long long)1e18; constexpr long long MOD = 1'000'000'007; string yn(bool f){return f?"Yes":"No";} string YN(bool f){return f?"YES":"NO";} signed main(){ // cin.tie(nullptr); // ios::sync_with_stdio(false); // cout<<fixed<<setprecision(10); int N; vector<int> ans; cin>>N; for(int i = 1; i <= N; i++){ bool flag = true, flag2 = false; cout<<"? "<<N-1<<endl; for(int j = 1; j <= N; j++){ if(i == j) continue; if(flag2) cout<<" "; cout<<j; flag2 = true; } cout<<endl; cout<<flush; int a; cin>>a; if(!a) ans.push_back(i); } sort(ans.begin(), ans.end()); cout<<"! "<<ans.size()<<endl; for(int i = 0; i < ans.size(); i++){ if(i) cout<<" "; cout<<ans[i]; cout<<flush; } cout<<endl; cout<<flush; return 0; }