# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
425604 | ngrace | Unscrambling a Messy Bug (IOI16_messy) | C++14 | 2 ms | 332 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 "messy.h"
#include <vector>
#include <iostream>
#include <utility>
#include <algorithm>
using namespace std;
#define v vector
#define pii pair<int,int>
#define fi first
#define se second
std::vector<int> restore_permutation(int n, int w, int r) {
for(int i=1;i<=n;i++){
string add;
for(int j=0;j<i;j++) add.push_back('1');
while(add.size()!=n) add.push_back('0');
add_element(add);
}
compile_set();
v<int> perm(n,-1);
for(int i=0;i<n;i++){
string base;
for(int j=0;j<n;j++){
if(perm[j]==-1) base.push_back('0');
else base.push_back('1');
}
for(int j=0;j<n;j++){
string check=base;
if(check[j]=='0') check[j]='1';
else continue;
if(check_element(check)){
perm[j]=i;
break;
}
}
}
return perm;
}
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... |