# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
627739 | flappybird | Super Dango Maker (JOI22_dango3) | C++17 | 996 ms | 732 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;
namespace {
int N, M;
} // namespace
void solve(vector<int>& v) {
int sz = v.size();
sz /= N;
if (sz == 1) {
Answer(v);
return;
}
int lim = sz / 2;
int i;
vector<int> rem, sub;
while (v.size()) {
int t = v.back();
int c = 0;
v.pop_back();
for (auto x : v) rem.push_back(x);
if (Query(rem) < lim) c = 1;
rem.resize(rem.size() - v.size());
if (c) rem.push_back(t);
else sub.push_back(t);
}
solve(rem);
solve(sub);
}
void Solve(int _N, int _M) {
N = _N;
M = _M;
int i;
vector<int> all;
for (i = 1; i <= N * M; i++) all.push_back(i);
solve(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... |