| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1369052 | mariza | Unscrambling a Messy Bug (IOI16_messy) | C++20 | 1 ms | 580 KiB |
#include "messy.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<int> restore_permutation(int n, int w, int r) {
string s;
for(ll i=0; i<n; i++) s+='0';
for(ll i=0; i<n; i++){
s[i]='1';
if((1ll<<0)&i){
add_element(s);
}
s[i]='0';
}
for(ll k=1; k<7; k++){
for(ll i=0; i<n; i++){
s[i]='1';
if((1ll<<k)&i){
for(ll j=0; j<n; j++){
if(((1ll<<(k-1))&i)!=((1ll<<(k-1))&j)) s[j]='1';
}
add_element(s);
for(ll j=0; j<n; j++){
if(((1ll<<(k-1))&i)!=((1ll<<(k-1))&j)) s[j]='0';
}
}
s[i]='0';
}
}
compile_set();
vector<int> p(n,0);
for(ll i=0; i<n; i++){
s[i]='1';
if(check_element(s)){
p[i]+=1;
}
s[i]='0';
}
for(ll k=1; k<7; k++){
for(ll i=0; i<n; i++){
s[i]='1';
for(ll j=0; j<n; j++){
if(((1ll<<(k-1))&p[i])!=((1ll<<(k-1))&p[j])) s[j]='1';
}
// cout<<k<<" "<<i<<": "<<s<<endl;
if(check_element(s)){
p[i]+=(1ll<<k);
}
for(ll j=0; j<n; j++){
if(((1ll<<(k-1))&p[i])!=((1ll<<(k-1))&p[j])) s[j]='0';
}
s[i]='0';
}
}
return p;
}
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
