#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]);
}
# |
결과 |
실행 시간 |
메모리 |
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 |
600 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
348 KB |
Output is correct |
2 |
Correct |
3 ms |
348 KB |
Output is correct |
3 |
Correct |
3 ms |
344 KB |
Output is correct |
4 |
Correct |
4 ms |
516 KB |
Output is correct |
5 |
Correct |
3 ms |
344 KB |
Output is correct |
6 |
Correct |
3 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
51 ms |
604 KB |
Output is correct |
2 |
Correct |
49 ms |
604 KB |
Output is correct |
3 |
Correct |
65 ms |
636 KB |
Output is correct |
4 |
Correct |
100 ms |
588 KB |
Output is correct |
5 |
Correct |
48 ms |
604 KB |
Output is correct |
6 |
Correct |
49 ms |
624 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
191 ms |
784 KB |
Output is correct |
2 |
Correct |
194 ms |
692 KB |
Output is correct |
3 |
Correct |
265 ms |
780 KB |
Output is correct |
4 |
Correct |
262 ms |
604 KB |
Output is correct |
5 |
Correct |
187 ms |
600 KB |
Output is correct |
6 |
Correct |
235 ms |
728 KB |
Output is correct |