#include "dango3.h"
#include <bits/stdc++.h>
using namespace std;
//code
#define show(x,y) cout << y << " " << #x << endl;
#define show2(x,y,i,j) cout << y << " " << #x << " " << j << " " << #i << endl;
#define show3(x,y,i,j,p,q) cout << y << " " << #x << " " << j << " " << #i << " " << q << " " << #p << endl;
#define show4(x,y) for(auto it:y) cout << it << " "; cout << #x << endl;
typedef pair<int,int>pii;
typedef pair<pii,pii>pi2;
//Query() Answer()
void Solve(int n, int m) {
vector<int>arr[m];
arr[0].push_back(1);
vector<int>v;
for(int x=n*m;x>=2;x--){
v.push_back(x);
}
for(int x=2;x<=n*m;x++){
unordered_set<int>se;
for(int y=0;y<m;y++){
for(auto it:arr[y]) se.insert(it);
vector<int>que;
for(int i=1;i<=n*m;i++){
if(i==x) continue;
if(se.find(i)!=se.end()) continue;
que.push_back(i);
}
int hold=Query(que);
if(hold==m-y-1){
arr[y].push_back(x);
break;
}
}
}
for(int x=0;x<m;x++){
Answer(arr[x]);
}
}
//code
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 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 |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
344 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
64 ms |
348 KB |
Output is correct |
2 |
Correct |
62 ms |
440 KB |
Output is correct |
3 |
Correct |
60 ms |
532 KB |
Output is correct |
4 |
Correct |
62 ms |
348 KB |
Output is correct |
5 |
Correct |
69 ms |
528 KB |
Output is correct |
6 |
Correct |
63 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2481 ms |
900 KB |
Wrong Answer [3] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5111 ms |
1172 KB |
Wrong Answer [3] |
2 |
Halted |
0 ms |
0 KB |
- |