이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |