# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
945312 | Nika533 | Unscrambling a Messy Bug (IOI16_messy) | C++14 | 1 ms | 600 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.
#pragma GCC diagnostic warning "-std=c++11"
#include "messy.h"
#include <bits/stdc++.h>
#define pb push_back
#define f first
#define s second
#define MOD 1000000007
#define flush fflush(stdout)
#define all(x) (x).begin(),(x).end()
#define allr(x) (x).rbegin(), (x).rend()
#define pii pair<int,int>
using namespace std;
vector<int> restore_permutation(int n, int w, int r) {
// add_element("0");
// compile_set();
// check_element("0");
string s="";
for (int i=0; i<n; i++) s.pb('0');
for (int i=0; i<n; i++) {
s[i]='1';
add_element(s);
}
compile_set();
vector<int> p(n,0);
s="";
for (int i=0; i<n; i++) s.pb('0');
for (int i=0; i<n; i++) {
string s2=s;
for (int j=0; j<n; j++) {
if (s2[j]=='0') {
s2[j]='1';
if (check_element(s2)) {
p[j]=i;
s[j]='1';
break;
}
s2[j]='0';
}
}
}
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... |