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;
const long long inf = (long long) 1e18 + 10;
const int inf1 = (int) 1e9 + 10;
// #define int long long
#define dbl long double
#define endl '\n'
#define sc second
#define fr first
#define mp make_pair
#define pb push_back
#define all(x) x.begin(), x.end()
#define maxn
vector<int> restore_permutation(int n, int w, int r) {
vector<pair<int,int>> v;
for(int i = 0; i < n; i++) {
v.pb(mp(rand()%150,i));
}
sort(all(v));
vector<int> p1(n,0);
for(int i = 1; i <= n; i++) {
string s;
for(int j = 0; j < i; j++) s.pb('1');
for(int j = 0; j < n-i; j++) s.pb('0');
add_element(s);
}
compile_set();
string cur(n,'0');
for(int i = 0; i < n; i++) {
//encontrar qual j tem p[j] = i
for(auto X : v) {
int j = X.sc;
if(cur[j] == '1') continue;
cur[j] = '1';
bool ok;
// cout << cur << " " << ok ? "false" : "true" << endl;
ok = check_element(cur);
// cout << cur << " " << ok ? "false" : "true" << endl;
if(ok) {
p1[j] = i;
break;
}
cur[j] = '0';
}
}
return p1;
}
# | 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... |