# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
276264 | brcode | Unscrambling a Messy Bug (IOI16_messy) | C++14 | 1 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 <iostream>
#include <bits/stdc++.h>
#include "messy.h"
using namespace std;
const int MAXN = 5010;
bool blocked[MAXN];
vector<int> v1;
vector<int> restore_permutation(int bits,int r,int w){
vector<int> p(bits);
string s="";
s+='1';
for(int i=2;i<=bits;i++){
s+='0';
}
add_element(s);
for(int i=1;i<bits;i++){
s[i] = '1';
add_element(s);
}
compile_set();
s = "";
for(int i=1;i<=bits;i++){
s+='0';
}
for(int i=0;i<bits;i++){
int currbit = -1;
for(int j=0;j<bits;j++){
if(blocked[j]){
continue;
}
s[j] = '1';
if(check_element(s)){
p[i] = j;
blocked[j]=true;
v1.push_back(p[i]);
break;
}
s[j] = '0';
}
for(int j=0;j<bits;j++){
s[j] = '0';
}
for(int x:v1){
s[x] = '1';
}
}
return p;
}
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... |