| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1301381 | DeltaStruct | Unscrambling a Messy Bug (IOI16_messy) | C++20 | 2 ms | 580 KiB |
#include <bits/stdc++.h>
using namespace std;
#include "messy.h"
vector<int> restore_permutation(int n,int w,int r){
int m = 0; while((1<<m)!=n) ++m;
string s(n,'1'); for (int i(0);i < 3;++i) s[i] = '0',add_element(s);
s = string(n,'0');
for (int i(0);i < n;++i) for (int k(0);k < 7;++k) if ((i>>k)&1){
for (int j(0);j < 3;++j) s[j] = '0'+((k>>j)&1);
s[i] = '1',add_element(s),s[i] = '0';
for (int j(0);j < 3;++j) s[k] = '0';
}
compile_set();
vector<int> R(n,-2),T;
if (m!=7){
string s(n,'1');
for (int i(0);i < n;++i){
s[i] = '0';
if (check_element(s)){ R[i] = 0,T.emplace_back(i); break; }
else s[i] = '1';
}
for (int i(0);i < n;++i) if (R[i]==-2){
s[i] = '0';
if (check_element(s)){ R[i] = 1,T.emplace_back(i); break; }
else s[i] = '1';
}
for (int i(0);i < n;++i) if (R[i]==-2){
s[i] = '0';
if (check_element(s)){ R[i] = 2,T.emplace_back(i); break; }
else s[i] = '1';
}
for (int i(0);i < n;++i) for (int k(0);k < 7;++k){
string s(n,'0'); for (int j(0);j < 3;++j) if ((k>>j)&1) s[T[j]] = '1';
s[i] = '1',R[i] |= (1<<k)*check_element(s),s[i] = '0';
for (int j(0);j < 3;++j) s[T[j]] = '0';
}
}
// check m!=7 solution
return R;
}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... | ||||
