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 <vector>
#include <iostream>
#include "messy.h"
std::vector<int> restore_permutation(int n, int w, int r)
{
for (int i = 1; i <= n; i++)
{
//std::cerr << (std::string(i, '1') + std::string(n-i, '0')) << '\n';
add_element(std::string(i, '1') + std::string(n-i, '0'));
}
compile_set();
std::string base(n, '0');
std::vector<int> ans(n);
for (int j = 0; j < n; j++)
{
for (int i = 0; i <n; i++)
{
std::string now = base;
now[i] = '1';
if (now != base)
{
//std::cerr << now << '\n';
if (check_element(now))
{
base = now;
ans[i] = j;
//std::cerr << i << ' ' << j << '\n';
break;
}
}
}
}
return ans;
}
# | 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... |