이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "messy.h"
using namespace std;
vector<int> restore_permutation(int n, int w, int r) {
	for (int i = 0; i < n; ++i) {
		string s = "";
		for (int j = 0; j < n; ++j) {
			if (j <= i) s+= "1";
			else s += "0";
		}
		add_element(s);
		//cout << s << endl;
	}
	compile_set();
	vector<int> p(n);
	vector<int> a(n);
	srand(420);
	for (int i = 0; i < n; ++i) a[i] = i;
	random_shuffle(a.begin(), a.end());
	string got = "";
	for (int i = 0; i < n; ++i) got += "0";
	for (int i = 0; i < n; ++i) {
		for (int j : a) {
			if(got[j] == '1') continue;
			got[j] = '1';
			bool r = check_element(got);
			if (r) {
				//cout << got << "\n";
				p[j] = i;
				break;
			} else got[j] = '0';
		}
	}
	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... |