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;
#define fi first
#define se second
#define pb push_back
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define mp make_pair
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int MAXN = 2e5+10;
const int MOD = 1e9+7;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3f;
vector<int> restore_permutation(int n, int w, int r) {
string s="";
for(int i=0;i<n;i++) s+='0';
for(int i=0;i<n;i++){
s[i]='1';
add_element(s);
//cout << "added: " << s << "\n";
}
compile_set();
s="";
for(int i=0;i<n;i++) s+='0';
srand(time(0));
vector<int> ans(n);
for(int i=0;i<n;i++){
vector<int> ord;
for(int j=0;j<n;j++){
if(s[j]=='1') continue;
ord.pb(j);
}
random_shuffle(all(ord));
//cout << s << "\n";
for(auto u : ord){
s[u]='1';
if(check_element(s)){
//cout << s << "\n";
ans[u]=i;
break;
}
s[u]='0';
}
}
//cout << (int)ans.size() << "\n";
return ans;
}
# | 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... |