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 dfs(vector<int> a, int m) {
if(m < 1) return;
if(m < 2) return Answer(a);
vector<int> L, R;
for(int i = size(a); i--; ) {
vector<int> q(L);
for(int j = i; j--; ) q.push_back(a[j]);
(Query(q) < m / 2 ? L : R).push_back(a[i]);
}
dfs(L, m / 2), dfs(R, m - m / 2);
}
void Solve(int N, int M) {
vector<int> a(N*M);
iota(begin(a), end(a), 1);
dfs(a, M);
}
# | 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... |