QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#769535 | #1834. Eulerian? | Vermeil | RE | 0ms | 0kb | C++17 | 1.1kb | 2024-11-21 18:04:09 | 2024-11-21 18:04:14 |
answer
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pil = pair<int, ll>;
int ask(vector<int> &v){
cout<<"? "<<(int)v.size()<<" ";
for (int i: v) cout<<i<<" ";
cout<<endl;
int ret;
cin>>ret;
return ret;
}
signed main() {
std::ios_base::sync_with_stdio(false);
std::cin.tie(nullptr);
int n;
cin>>n;
vector<int> v;
vector<int> p;
iota(p.begin(), p.end(), 1);
for (int i=1;i<=n;i++)v.push_back(i);
int m = ask(v);
v.clear();
random_device rd;
for (int i=0;i<29;i++){
int e1, e2, ot;
shuffle(p.begin(), p.end(), default_random_engine(rd()));
vector<int> v1, v2;
for (int j=0;j<n/2;j++) v1.push_back(p[j]);
for (int j=n/2;j<n;j++) v2.push_back(p[j]);
e1 = ask(v1);
e2 = ask(v2);
ot = m - e1 - e2;
if ((e1 + ot) & 1){
cout<<"! NO";
return 0;
}
}
cout<<"! YES";
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Runtime Error
input:
3 2
output:
? 3 1 2 3