# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
945250 | socpite | Super Dango Maker (JOI22_dango3) | C++17 | 380 ms | 964 KiB |
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<bits/stdc++.h>
using namespace std;
int Query(const std::vector<int> &x);
void Answer(const std::vector<int> &a);
void dnc_solve(int N, int M, const vector<int> &a){
if(M == 1){
Answer(a);
return;
}
vector<int> v1, v2;
for(int i = 0; i < a.size(); i++){
vector<int> nw = v1;
for(int j = i + 1; j < a.size(); j++)nw.push_back(a[j]);
if(Query(nw) < M/2)v1.push_back(a[i]);
else v2.push_back(a[i]);
}
dnc_solve(N, M/2, v1);
dnc_solve(N, (M+1)/2, v2);
}
void Solve(int N, int M) {
vector<int> vec(N*M);
iota(vec.begin(), vec.end(), 1);
dnc_solve(N, M, vec);
}
Compilation message (stderr)
# | 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... |