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) {
std::string str = "";
std::vector<int> ans;
for (int i = 0; i < n; ++i)
{
str += "0";
ans.push_back(0);
}
for (int i = 0; i < n; ++i)
{
str[i] = '1';
add_element(str);
}
compile_set();
for (int i = 0; i < n; ++i)
{
str[i] = '0';
}
for (int i = 0; i < n; ++i)
{
for (int j = 0; j < n; ++j)
{
if (str[j] == '1')
continue;
str[j] = '1';
bool checked = check_element(str);
if (checked)
{
ans[j] = i;
break;
}
else
{
str[j] = '0';
}
}
}
/*
for (int i = 0; i < n; ++i)
{
std::cout << ans[i] << " ";
}*/
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... |