# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1077918 | 0npata | Super Dango Maker (JOI22_dango3) | C++17 | 1905 ms | 1408 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 "dango3.h"
#include<bits/stdc++.h>
using namespace std;
#define vec vector
const int MXSZ = 400*25;
void Solve(int N, int M) {
vec<int> all(N*M);
iota(all.begin(), all.end(), 1);
function<void(vec<int>)> divandconq = [&](vec<int> v) {
if(v.size() == N){
Answer(v);
return;
}
vec<int> v1{};
vec<int> v2{};
set<int> cur;
for(int i : v) cur.insert(i);
int tm = (v.size()/N)/2;
for(int i = 0; i<v.size(); i++) {
cur.erase(v[i]);
if(Query(vec<int>(cur.begin(), cur.end())) >= tm) {
v1.push_back(v[i]);
}
else {
v2.push_back(v[i]);
cur.insert(v[i]);
}
}
divandconq(v1);
divandconq(v2);
};
divandconq(all);
}
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... |