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 "messy.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(v) v.begin(), v.end()
#define FOR(i, n) for (int i = 0; i < n; i++)
std::vector<int> restore_permutation(int n, int w, int r) {
int log = (int)(log2(n) + 0.5);
FOR(l, log){
FOR(i, n){
if(i & (1 << l)){
string t(n, '0');
FOR(j, n){
bool on = 0;
FOR(k, l){
if(((j & (1 << k)) ^ (i & (1 << k)))) on = 1;
}
if(on) t[j] = '1';
}
t[i] = '1';
add_element(t);
}
}
}
compile_set();
vector<int> p(n, 0);
FOR(l, log){
FOR(i, n){
string t(n, '0');
FOR(j, n){
bool on = 0;
FOR(k, l){
if(((p[j] & (1 << k)) ^ (p[i] & (1 << k)))) on = 1;
}
if(on) t[j] = '1';
}
t[i] = '1';
if(check_element(t)){
p[i] |= (1 << l);
}
}
}
return p;
}
# | 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... |