# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1270170 | kl0989e | Unscrambling a Messy Bug (IOI16_messy) | C++20 | 0 ms | 328 KiB |
#include "messy.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pi pair<int, int>
#define pl pair<ll, ll>
#define vi vector<int>
#define vl vector<ll>
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(),(x).end()
vi restore_permutation(int n, int w, int r) {
string s(n,'0');
for (int i=0; i<n-1; i++) {
s[i]='1';
add_element(s);
}
compile_set();
vi resp(n,n-1);
string rem(n,'0');
for (int i=0; i<n-1; i++) {
for (int j=0; j<n; j++) {
if (rem[j]=='0') {
rem[j]='1';
if (check_element(rem)) {
resp[j]=i;
break;
}
rem[j]='0';
}
}
}
return resp;
}
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... |