이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define fr(i, n, m) for(int i = (n); i < (m); i ++)
#define pb push_back
#define st first
#define nd second
#define pq priority_queue
#define all(x) begin(x), end(x)
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
const ll inf = 1e9;
const ll mod = 1e9 + 7;
const ld eps = 1e-13;
const int mxN = 200000;
#include "messy.h"
/*
vector<int> secret = {5, 3, 1, 4, 7, 6, 0, 2};
set<string> S;
void add_element(string s){
string s2 = s;
fr(i, 0, 8){
s2[i] = s[secret[i]];
}
S.insert(s2);
}
void compile_set(){
}
bool check_element(string s){
return S.find(s) != S.end();
}*/
vector<int> restore_permutation(int n, int w, int r){
string s(n, '0');
fr(i, 0, n){
s[i] = '1';
add_element(s);
}
compile_set();
fr(i, 0, n) s[i] = '0';
vector<int> p(n);
fr(i, 0, n){
string temp = s;
fr(j, 0, n){
if(s[j] == '1') continue;
temp[j] = '1';
bool c = check_element(temp);
if(c == true){
s = temp;
p[j] = i;
break;
}
temp[j] = '0';
}
}
return p;
}/*
int main(){
vector<int> p = restore_permutation(8, 100, 100);
for(auto u : p) cout << u <<' ';
cout<<endl;
}
*/
# | 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... |