# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
95660 | dwsc | Unscrambling a Messy Bug (IOI16_messy) | C++14 | 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 "messy.h"
#include <bits/stdc++.h>
using namespace std;
std::vector<int> restore_permutation(int n, int w, int r) {
int solved[n] = {0};
for (int i = 0; i < n; i++){
string s = "";
for (int j = 0; j <= i; j++) s += '1';
for (int j = i+1; j < n; j++) s += '0';
add_element(s);
//cout << s << "hi\n";
}
compile_set();
vector<int> perm;
for (int i =0; i < n; i++) perm.push_back(-1);
for (int i = 0; i < n; i++){
for (int j = 0; j < n; j++){
if (perm[j] != -1) continue;
string s = "";
for (int k = 0; k < n; k++){
if (perm[k] != -1){
s += '1';
}
else if (k == j) s += '1';
else s += '0';
}
//cout << s <<" " << "\n";
if (check_element(s)){
// cout << j << "hi\n";
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... |