Submission #618946

#TimeUsernameProblemLanguageResultExecution timeMemory
618946Dremix10Unscrambling a Messy Bug (IOI16_messy)C++17
38 / 100
1 ms340 KiB
#include "messy.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pi;
typedef pair<ll,ll> pl;
#define endl '\n'
#define all(x) (x).begin(),(x).end()
#define F first
#define S second
#ifdef dremix
    #define p(x) cerr<<#x<<" = "<<x<<endl;
    #define p2(x,y) cerr<<#x<<" , "<<#y<<" = "<<x<<" , "<<y<<endl;
    #define pp(x) cerr<<#x<<" = "<<x.F<<"-"<<x.S<<endl;
    #define pv(x) cerr<<#x<<" = {";for(auto v : x)cerr<<v<<", ";cerr<<"}"<<endl;
    #define ppv(x) cerr<<#x<<" = {";for(auto v : x)cerr<<v.F<<"-"<<v.S<<", ";cerr<<"}"<<endl;
#else
    #define p(x) {}
    #define p2(x,y) {}
    #define pp(x) {}
    #define pv(x) {}
    #define ppv(x) {}
#endif
const int N = 3e5+5;
const int MOD = 1e9+7;
const ll INF = 1e18+5;


std::vector<int> restore_permutation(int n, int w, int r) {
    int i;
    string s = "", reset = "";

    for(i=0;i<n;i++)reset += '0';

    s = reset;
    for(i=0;i<n;i++){
        s[i] = '1';
        p(s)
        add_element(s);
    }

    compile_set();
    vector<int> ans(n,-1);

    int j;
    
    s = reset;
    for(i=0;i<n;i++){
        

        for(j=0;j<n;j++){
            if(ans[j] == -1)continue;
            s[j] = '1';
        }

        for(j=0;j<n;j++){
            if(ans[j] != -1)continue;
            s[j] = '1';
            bool p = check_element(s);
            s[j] = '0';

            if(p){
                ans[j] = i;
                break;
            }
        }

    }

    /*
    add_element("0");
    compile_set();
    check_element("0");
    return std::vector<int>();
    */

   return ans;
}
#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...