# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
95199 | someone_aa | Unscrambling a Messy Bug (IOI16_messy) | C++17 | 3 ms | 384 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 <vector>
#include <bits/stdc++.h>
#include "messy.h"
using namespace std;
bool taken[130];
std::vector<int> restore_permutation(int n, int w, int r) {
string zeros;
for(int i=0;i<n;i++) {
zeros += "0";
}
for(int i=1;i<n;i++) {
string tmp = zeros;
for(int j=1;j<=i;j++) {
tmp[j-1] = '1';
}
add_element(tmp);
}
compile_set();
vector<int>result(n, 0);
string tmp = zeros;
for(int i=1;i<=n;i++) {
for(int j=0;j<n;j++) {
if(!taken[j]) {
tmp[j] = '1';
if(check_element(tmp)) {
taken[j] = true;
result[j] = i-1;
break;
}
else {
tmp[j] = '0';
}
}
}
}
for(int i=0;i<result.size();i++) {
if(!taken[i]) result[i] = n - 1;
}
return result;
}
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |