| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1298239 | hssaan_arif | Unscrambling a Messy Bug (IOI16_messy) | C++20 | 0 ms | 0 KiB |
#include "messy.h"
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define pb push_back
// #define int long long
#define fi first
#define se second
const int N = 3e5 + 5, M = 1e9 + 7, LG = 20;
int n , A[N] , w , r;
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-1 ; i++){
s[i] = '1';
add_element(s);
}
compile_set();
int su = 0;
vector<int> P(n)
map<int,int> in;
for (int i=0 ; i<n-1 ; i++){
string t = "";
for (int j=0 ; j<n ; j++){
if (in[j]){
t += '1';
}else{
t += '0';
}
}
for (int j=0 ; j<n ; j++){
if (t[j] == '0'){
t[j] = '1';
bool x = check_element(t);
if (x){
in[j] = 1;
P[i] = j;
su += j;
break;
}
t[j] = '0';
}
}
}
P[n-1] = (n*(n-1))/2 - su;
// check_element("0");
return P;
}
// signed main(){
// cin >> n >> w >> r;
// restore_permutation(n,w,r);
// }
