# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1108269 | akzytr | Unscrambling a Messy Bug (IOI16_messy) | C++17 | 1 ms | 508 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>
using namespace std;
#define ll long long
#define ar array
#define ve vector
#define sz(a) ((int)(a).size())
void add_element(std::string x);
bool check_element(std::string x);
void compile_set();
ve<int> restore_permutation(int n, int w, int r) {
ve<int> p(n, 0);
string x = "";
for(int i = 0; i < n; i++) {
x += '0';
}
assert(x.size() == n);
for(int i = 0; i < n; i++) {
x[i] = '1';
add_element(x);
}
compile_set();
x = "";
for(int i = 0; i < n; i++) {
x += '0';
}
for(int i = 0; i < n; i++) {
for(int j = 0; j < n; j++) {
if(x[j] != '1') {
x[j] = '1';
if(check_element(x)) {
p[j] = i;
break;
}
x[j] = '0';
}
}
}
return p;
}
/*
How to make better use of the writes?
[0,1,2,3]
1 1 0 0
0 0 1 1
*/
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... |