QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#655221#1834. Eulerian?jiangzhihuiWA 2ms3672kbC++201.1kb2024-10-19 01:36:362024-10-19 01:36:42

Judging History

你现在查看的是最新测评结果

  • [2024-10-19 01:36:42]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3672kb
  • [2024-10-19 01:36:36]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int N=1919810;
typedef long long ll;
typedef pair<ll,ll> PII;
int n,m,k;
int a[N],b[N];
char s[N];
vector<PII> e[N];
int d[N];
bool tf[N];


int query(vector<int> &v){
    cout<<"? "<<v.size()<<" ";
    for(auto x:v) cout<<x<<" ";
    cout<<endl;
    int x;
    cin>>x;
    return x;
}

mt19937 rnd(time(0));
int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cin>>n;
    vector<int> v;
    for(int i=1;i<=n;i++) v.push_back(i);
    int tot=query(v);
    if(tot<n){
        cout<<"! NO"<<endl;
        return 0;
    }
    for(int i=1;i<=30;i++){
        vector<int> v1,v2;
        while(!v1.size()||!v2.size()){
            v1.clear(),v2.clear();
            for(int j=1;j<=n;j++){
            int x=rnd()%2;
            if(x) v2.push_back(j);
            else v1.push_back(j);
            }
        }
        
        
            if((tot-query(v1)-query(v2))%2){
                cout<<"! NO"<<endl;
                return 0;
            }
        
    }
    cout<<"! YES"<<endl;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 3672kb

input:

3
2

output:

? 3 1 2 3 
! NO

result:

ok correct

Test #2:

score: -100
Wrong Answer
time: 0ms
memory: 3636kb

input:

3
3
1
0
1
0
0
1
1
0
0
1
1
0
1
0
1
0
0
1
1
0
0
1
1
0
0
1
0
1
1
0
1
0
1
0
0
1
1
0
1
0
0
1
1
0
1
0
1
0
0
1
0
1
1
0
0
1
1
0
1
-1

output:

? 3 1 2 3 
? 2 2 3 
? 1 1 
? 2 1 3 
? 1 2 
? 1 1 
? 2 2 3 
? 2 1 2 
? 1 3 
? 1 1 
? 2 2 3 
? 2 1 3 
? 1 2 
? 2 2 3 
? 1 1 
? 2 1 3 
? 1 2 
? 1 3 
? 2 1 2 
? 2 2 3 
? 1 1 
? 1 1 
? 2 2 3 
? 2 1 3 
? 1 2 
? 1 3 
? 2 1 2 
? 1 2 
? 2 1 3 
? 2 1 2 
? 1 3 
? 2 1 2 
? 1 3 
? 2 2 3 
? 1 1 
? 1 2 
? 2 1 3 
?...

result:

wrong output format Unexpected end of file - token expected