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>
#define pb push_back
#define mp make_pair
#define inside sl<=l&&r<=sr
#define outside r<sl||sr<l
#define orta ((l+r)>>1)
#define INF 1000000009
#define mod 1000000007
#define ppair(x); cerr << "(" << x.first << ", " << x.second << ")\n";
#define bas(x) #x << ": " << x << " "
#define prarr(x, n); cerr << #x << ": "; for(int qsd = 0; qsd < n; qsd++) cerr << x[qsd] << " "; cerr << "\n";
#define prarrv(x); cerr << #x << ": "; for(int qsd = 0; qsd < (int)x.size(); qsd++) cerr << x[qsd] << " "; cerr << "\n";
using namespace std;
typedef long long ll;
int n, w, r;
vector<int> restore_permutation(int N, int W, int R) {
	n = N;
	w = W;
	r = R;
	
	string add = "";
	for (int i = 0; i < n; i++) add += "0";
	for (int i = 0; i < n; i++){
		add[i] = '1';
		add_element(add);
	}
	
	compile_set();
	
	vector<int> perm(n);
	string res = "";
	for (int i = 0; i < n; i++) res += "0";
	for (int i = 0; i < n; i++){
		for (int j = 0; j < n; j++){
			if (res[j] == '1') continue;
			string sor = res;
			sor[j] = '1';
			if (check_element(sor)){
				perm[j] = i;
				res[j] = '1';
				break;
			}
		}
	}
	
	return perm;
	
    /*add_element("0000");
    compile_set();
    check_element("0000");
    return vector<int>{0, 1, 2, 3};*/
}
| # | 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... |