結果
問題 |
No.934 Explosive energy drink
|
ユーザー |
![]() |
提出日時 | 2023-04-16 17:55:51 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 323 ms / 2,000 ms |
コード長 | 1,324 bytes |
コンパイル時間 | 3,784 ms |
コンパイル使用メモリ | 255,496 KB |
最終ジャッジ日時 | 2025-02-12 09:15:03 |
ジャッジサーバーID (参考情報) |
judge4 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 |
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using namespace atcoder; using ll=long long; using ld=long double; ld pie=3.141592653589793; ll inf=1444999999; ll mod=1000000007; int main(){ ll n; cin >> n; vector<ll>a,b; for (ll i = 0; i < n; i++) { a.push_back(i+1); } while (!a.empty()) { ll x=a.size(); x+=b.size(); if (x==2) { for (ll i = 0; i < a.size(); i++) { b.push_back(a[i]); } break; } cout << "? " << x-1 << endl; vector<ll>c; for (ll i = 0; i < b.size(); i++) { c.push_back(b[i]); } ll aa=a.size(); for (ll i = 0; i < aa-1; i++) { c.push_back(a[i]); } sort(c.begin(),c.end()); for (ll i = 0; i < c.size(); i++) { cout << c[i] << ' '; } cout << endl; ll y; cin >> y; if (y==0) { b.push_back(a[a.size()-1]); a.pop_back(); }else{ a.pop_back(); } } cout << "! " << b.size() << endl; sort(b.begin(),b.end()); for (ll i = 0; i < b.size(); i++) { cout << b[i]<< ' '; } cout << endl; }