# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1039313 | Andrey | Super Dango Maker (JOI22_dango3) | C++17 | 641 ms | 852 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;
vector<int> ans[1000];
int br = 0;
void dude(int n, int m, vector<int> haha) {
int c = haha.size()/n;
if(c == 0) {
return;
}
if(c == 1) {
ans[br] = haha;
br++;
return;
}
int mid = c/2;
vector<bool> yeah(haha.size(),true);
for(int i = 0; i < haha.size(); i++) {
vector<int> a(0);
yeah[i] = false;
for(int j = 0; j < haha.size(); j++) {
if(yeah[j]) {
a.push_back(haha[j]);
}
}
if(Query(a) < mid) {
yeah[i] = true;
}
}
vector<int> a(0);
vector<int> b(0);
for(int i = 0; i < haha.size(); i++) {
if(yeah[i]) {
a.push_back(haha[i]);
}
else {
b.push_back(haha[i]);
}
}
dude(n,m,a);
dude(n,m,b);
}
void Solve(int n, int m) {
vector<int> haha(0);
for(int i = 1; i <= n*m; i++) {
haha.push_back(i);
}
dude(n,m,haha);
for(int i = 0; i < m; i++) {
Answer(ans[i]);
}
}
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... |