#include "dango3.h"
#include <bits/stdc++.h>
using namespace std;
vector< vector<int> > dnq(vector<int> idx, int need){
if(need == 1){
vector< vector<int> > res(1);
res[0] = idx;
return res;
}
vector<int> n1 = idx, n2;
for(int i : idx){
n2.push_back(i);
n1.erase(n1.begin());
int cnt = Query(n1);
if(cnt < need / 2){
n1.push_back(n2.back());
n2.pop_back();
}
}
vector<vector<int> > v1 = dnq(n1, need / 2), v2 =dnq(n2, need - need / 2);
vector< vector<int> > res =v1;
for(auto i : v2) res.push_back(i);
return res;
}
void Solve(int n, int m){
vector<int> all;
for(int i = 1;i <= n * m; i++) all.push_back(i);
vector<vector<int> > vec = dnq(all, m);
for(int i = 0;i < m; i++) Answer(vec[i]);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 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 |
344 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
348 KB |
Output is correct |
2 |
Correct |
3 ms |
348 KB |
Output is correct |
3 |
Correct |
3 ms |
348 KB |
Output is correct |
4 |
Correct |
3 ms |
524 KB |
Output is correct |
5 |
Correct |
3 ms |
348 KB |
Output is correct |
6 |
Correct |
3 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
50 ms |
612 KB |
Output is correct |
2 |
Correct |
49 ms |
600 KB |
Output is correct |
3 |
Correct |
65 ms |
848 KB |
Output is correct |
4 |
Correct |
65 ms |
576 KB |
Output is correct |
5 |
Correct |
48 ms |
600 KB |
Output is correct |
6 |
Correct |
50 ms |
844 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
190 ms |
604 KB |
Output is correct |
2 |
Correct |
193 ms |
600 KB |
Output is correct |
3 |
Correct |
269 ms |
940 KB |
Output is correct |
4 |
Correct |
257 ms |
668 KB |
Output is correct |
5 |
Correct |
187 ms |
676 KB |
Output is correct |
6 |
Correct |
203 ms |
940 KB |
Output is correct |