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 <bits/stdc++.h>
#include "messy.h"
#include <vector>
using namespace std;
const int RANDOM = chrono::high_resolution_clock::now().time_since_epoch().count();
vector<int> restore_permutation(int n, int w, int r) {
string s = "";
for (int i = 0; i < n; i++){
s.push_back('1');
}
for (int i = 0; i < n; i++){
s[i] = '0';
add_element(s);
}
compile_set();
vector <int> frq(128);
vector <int> p (n);
s = "";
for (int i = 0; i < n; i++) {
s.push_back('1');
}
vector <int> v;
for (int i = 0; i < n; i++){
v.push_back(i);
}
mt19937 rng(RANDOM);
for (int i = 0; i < n; i++){
shuffle(v.begin(), v.end(), rng);
for (int j: v){
if (s[j] == '1') {
s[j] = '0';
if (check_element(s)) {
p[j] = i;
break;
}
s[j] = '1';
}
}
}
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... |