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 <ext/pb_ds/assoc_container.hpp>
#include "messy.h"
using namespace std;
using namespace __gnu_pbds;
///#define int long long
typedef tree<int,null_type,less<int>,rb_tree_tag,
tree_order_statistics_node_update> indexed_set;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vpi;
typedef vector<pll> vpl;
#define ff first
#define ss second
#define pb push_back
#define popb pop_back
#define all(x) (x).begin(),(x).end()
std::vector<int> restore_permutation(int n, int w, int r)
{
string cur = "";
for(int i = 0; i < n; i++)
cur += '1';
for(int i = 0; i < n; i++)
{
cur[i] = 0;
add_element(cur);
}
compile_set();
string ans = "";
set<int> rem;
for(int i = 0; i< n;i ++)
rem.insert(i);
for(int i= 0 ; i <n ;i ++)
ans += '1';
vi p(n);
for(int i = 0; i < n;i ++)
{
int cor;
for(auto e: rem)
{
ans[e] = '0';
if(check_element(ans))
{
cor =e;
break;
}
ans[e] = '1';
}
rem.erase(cor);
}
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... |