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 "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 |
---|
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... |