# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
702670 | finn__ | Swap (BOI16_swap) | C++17 | 520 ms | 262144 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 <bits/stdc++.h>
using namespace std;
#define N 200001
map<unsigned, unsigned *> dp[N];
map<unsigned, size_t> sz[N];
unsigned y[N];
unsigned *merge_subtrees(
unsigned f, size_t x, size_t y, unsigned const *const a, unsigned const *const b)
{
unsigned *c = (unsigned *)malloc((x + y + 1) * sizeof *c);
c[0] = f;
size_t k = 0, h = 1;
for (size_t i = 1; k < x; i <<= 1)
{
for (size_t j = k; j < x && j < k + i; j++)
c[h++] = a[j];
for (size_t j = k; j < y && j < k + i; j++)
c[h++] = b[j];
k += i;
}
return c;
}
void lexicographically_smallest(size_t n, unsigned i, unsigned j)
{
if (dp[i].find(j) != dp[i].end())
return;
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |