# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1042174 | XJP12 | Unscrambling a Messy Bug (IOI16_messy) | C++14 | 0 ms | 0 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 <bits/stdc++.h>
#include "messy.h"
using namespace std;
typedef vector<int> vi;
vector<string> bug;
int x1=2;
int z1=7;
bool check_element(string x){
for(int i=0; i<(int)bug.size(); i++){
if(bug[i]==x)return true;
}
return false;
}
void compile_set(){
for(int i=0; i<(int)bug.size(); i++){
swap(bug[i][x1], bug[i][z1]);
//cout<<bug[i]<<endl;
}
}
void add_element(string x){
bug.push_back(x);
}
vi restore_permutation(int n, int w, int r){
add_element("10101010");
add_element("10010010");
add_element("01001001");
add_element("10000001");
compile_set();
string s;
vi ans(n);