# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1121912 | ElayV13 | Unscrambling a Messy Bug (IOI16_messy) | C++17 | 4 ms | 764 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<iostream>
#include<vector>
using namespace std;
typedef long long ll;
vector<int> restore_permutation(int n,int W,int R){
string s[10];
for(int i=0;i<n-1;i++){
for(int j=0;j<=i;j++)s[i]+='0';
for(int j=i+1;j<n;j++)s[i]+='1';
add_element(s[i]);
}
compile_set();
for(int i=0;i<n;i++)for(int j=i;j<n;j++){
bool ok=1;
for(int k=0;k<n-1;k++){
string t=s[k];
swap(t[i],t[j]);
ok&=check_element(t);
}
if(ok){
vector<int> p(n);
for(int k=0;k<n;k++)p[k]=k;
swap(p[i],p[j]);
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... |