This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#include "dango3.h"
using namespace std;
/*
int Query(vector<int> v){
cout << "? ";
for(int x : v){
cout << x << " ";
}
cout << endl;
int x;
cin >> x;
return x;
}
void Answer(vector<int> v){
cout << "! ";
for(int x : v){
cout << x << " ";
}
cout << endl;
}*/
void Solve(int N , int M){
vector<vector<int>> a(M + 1) , u(M + 1 , vector<int>(N * M + 1));
for(int i = 1;i <= N * M;i ++){
int pos = 0;
for(int bit = 4;bit >= 0;bit --){
int v = pos + (1 << bit) , bad = 0;
if(v <= M){
vector<int> t;
for(int j = 1;j <= N * M;j ++){
if(!u[v][j] && j != i){
t.push_back(j);
}
}
bad = (M - Query(t) == 2);
}
if(bad){
pos = v;
}
}
++pos;
a[pos].push_back(i);
u[pos][i] = 1;
}
for(int i = 1;i <= M;i ++){
Answer(a[i]);
}
}/*
int main(){
Solve(3 , 2);
}*/
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |