Submission #95634

#TimeUsernameProblemLanguageResultExecution timeMemory
95634tqbfjotldUnscrambling a Messy Bug (IOI16_messy)C++14
0 / 100
3 ms428 KiB
#include "messy.h"
#include <vector>
#include <string>
using namespace std;
std::vector<int> restore_permutation(int n, int w, int r) {
    vector<string> original;
    for (int x = 0; x<n; x++){
        string s = "";
        for(int y = 0; y<n; y++){
            if (y<=x){
                s+="1";
            }
            else s+="0";
        }
        add_element(s);
        original.push_back(s);
    }
    compile_set();
    bool thing = true;
    int a,b;
    for (int x = 0; x<n; x++){
        if (thing&&!check_element(original[x])){
            a = x;
            thing=false;
        }
        if ((!thing)&&check_element(original[x])){
            b = x;
            thing = true;
        }
    }
    vector<int> v;
    for (int x = 0; x<n; x++){
        if (x==a) v.push_back(b);
        else if (x==b) v.push_back(a);
        else v.push_back(x);
    }
    return v;
}
#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...