제출 #571006

#제출 시각아이디문제언어결과실행 시간메모리
571006definitelynotmeeUnscrambling a Messy Bug (IOI16_messy)C++98
38 / 100
1 ms340 KiB
#include<bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define all(x) x.begin(),x.end()
using ll = long long;
using pii = pair<int,int> ;
using pll = pair<ll,ll>;
template<typename T>
using matrix = vector<vector<T>>;
const int INF =(1<<30)-1;
const ll INFL = (1ll<<61)-1;
#include "messy.h"

std::vector<int> restore_permutation(int n, int w, int r) {
    for(int i = 0; i < n; i++){
        string s(n,'0');
        fill(s.begin(),s.begin()+i+1,'1');
        add_element(s);
    }
    compile_set();
    vector<int> resp(n);
    string quest(n,'0');

    for(int i = 0; i < n; i++){
        for(int j = 0; j < n; j++){
            if(quest[j]!='1'){
                quest[j] = '1';
                bool ret = check_element(quest);
                if(ret){
                    resp[j] = i;
                    break;
                }
                quest[j] = '0';
            }
        }
    }
    return resp;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...