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 <vector>
#include<bits/stdc++.h>
using namespace std;
using ll = int;
#define pll pair <ll,ll>
#define fi first
#define se second
#define MP make_pair
#define sz(a) (ll((a).size()))
#define BIT(mask,i) (((mask) >> (i))&1)
#define MASK(i) (1LL << (i))
#include "messy.h"
std::vector<int> restore_permutation(int n, int w, int r) {
vector <ll> p(n,-1);
for (ll i = 0;i < n; i++){
string s;
s.resize(n);
for (ll j = 0;j < n;j ++){
if (j <= i)s[j] = '1';
else s[j] = '0';
}
add_element(s);
}
compile_set();
for (ll i = 0;i < n; i++){
string s;
s.resize(n,'0');
for (ll j = 0;j < n;j ++)if (p[j] != -1)s[j] = '1';
for (ll j = 0;j < n;j ++){
if (s[j]=='0'){
s[j] = '1';
if (check_element(s)){
// cout<<"OK"<<endl;
p[j] = i;
break;
}
s[j] = '0';
}
}
}
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... |