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>
using namespace std;
#include "messy.h"
//#define int long long
#define pi pair<int, int>
#define pii pair<int, pi>
#define fi first
#define se second
#ifdef _WIN32
#define getchar_unlocked _getchar_nolock
#endif
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
bool vis[130];
std::vector<int> restore_permutation(int n, int w, int r) {
vector <int> ans;
ans.resize(n);
for(int i=0;i<n;i++){
string tmp = "";
for(int j=0;j<=i;j++)tmp += "1";
for(int j=i+1;j<n;j++)tmp += "0";
add_element(tmp);
}
compile_set();
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
if(vis[j])continue;
string tmp = "";
for(int k=0;k<n;k++){
if(k == j || vis[k])tmp += "1";
else tmp += "0";
}
if(check_element(tmp)){
vis[j] = 1;
ans[j] = i;
break;
}
}
}
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... |