#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 |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
12 ms |
348 KB |
Output is correct |
2 |
Correct |
14 ms |
348 KB |
Output is correct |
3 |
Correct |
12 ms |
348 KB |
Output is correct |
4 |
Correct |
12 ms |
552 KB |
Output is correct |
5 |
Correct |
13 ms |
348 KB |
Output is correct |
6 |
Correct |
12 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
571 ms |
1112 KB |
Output is correct |
2 |
Correct |
580 ms |
1088 KB |
Output is correct |
3 |
Correct |
611 ms |
1088 KB |
Output is correct |
4 |
Correct |
573 ms |
1096 KB |
Output is correct |
5 |
Correct |
547 ms |
1108 KB |
Output is correct |
6 |
Correct |
534 ms |
1108 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2250 ms |
1628 KB |
Output is correct |
2 |
Correct |
2188 ms |
1676 KB |
Output is correct |
3 |
Correct |
2454 ms |
1772 KB |
Output is correct |
4 |
Correct |
2340 ms |
1624 KB |
Output is correct |
5 |
Correct |
2050 ms |
1676 KB |
Output is correct |
6 |
Correct |
2188 ms |
1692 KB |
Output is correct |