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>
#include "dango3.h"
using namespace std;
void dpr(int nb, vector<int> act) {
if(nb == 1) {
Answer(act);
return;
}
vector<int> del;
int mid = nb >> 1, sz = (int)act.size();
for(int i = sz-1; i >= 0; i--) {
int val = act[i];
act.erase(act.begin() + i);
if(Query(act) >= mid) {
del.push_back(val);
} else {
act.push_back(val);
}
}
dpr(mid, act);
dpr(nb - mid, del);
}
void Solve(int n, int m) {
vector<int> act;
for(int i = 1; i <= n * m; i++)
act.push_back(i);
dpr(m, act);
}
# | 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... |