# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
568712 | joelau | Super Dango Maker (JOI22_dango3) | C++17 | 2131 ms | 600 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> lst[30],v;
void Solve(int N, int M) {
for (int i = 0; i < N*M; ++i) v.push_back(i+1);
while (!v.empty()) {
int x = v.back(); v.pop_back();
int low = 0, high = M;
while (high - low > 1) {
int mid = (low+high)/2;
int n = 0;
for (int i = 0; i < mid; ++i) {
n += lst[i].size();
for (int j = 0; j < lst[i].size(); ++j) v.push_back(lst[i][j]);
}
int q = Query(v);
if (q == mid-1) high = mid;
else low = mid;
for (int i = 0; i < n; ++i) v.pop_back();
}
lst[low].push_back(x);
}
for (int i = 0; i < M; ++i) Answer(lst[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... |