Submission #569051

#TimeUsernameProblemLanguageResultExecution timeMemory
569051losmi247Unscrambling a Messy Bug (IOI16_messy)C++14
0 / 100
1 ms300 KiB
#include <bits/stdc++.h>
#include "messy.h"
using namespace std;
typedef long long ll;

int n,w,r;
vector <int> prvi(){
    add_element("11110000");
    add_element("11000000");
    add_element("00000011");
    add_element("10000000");
    add_element("00100000");
    add_element("00001000");
    add_element("00000010");

    compile_set();

    vector <int> ret(8,0);
    for(int i = 0; i < 8; i++) ret[i] = i;

    string s = "11110000";
    for(int i = 0; i < 4; i++){
        for(int j = 4; j < 8; j++){
            string h = s;
            swap(h[i],h[j]);
            if(check_element(h)){
                swap(ret[i],ret[j]);
                return ret;
            }
        }
    }

    s = "11000000";
    for(int i = 0; i < 2; i++){
        for(int j = 2; j < 4; j++){
            string h = s;
            swap(h[i],h[j]);
            if(check_element(h)){
                swap(ret[i],ret[j]);
                return ret;
            }
        }
    }

    s = "00000011";
    for(int i = 5; i < 7; i++){
        for(int j = 7; j < 8; j++){
            string h = s;
            swap(h[i],h[j]);
            if(check_element(h)){
                swap(ret[i],ret[j]);
                return ret;
            }
        }
    }

    s = "10000000";
    for(int i = 0; i < 1; i++){
        for(int j = 1; j < 2; j++){
            string h = s;
            swap(h[i],h[j]);
            if(check_element(h)){
                swap(ret[i],ret[j]);
                return ret;
            }
        }
    }

    s = "00100000";
    for(int i = 2; i < 3; i++){
        for(int j = 3; j < 4; j++){
            string h = s;
            swap(h[i],h[j]);
            if(check_element(h)){
                swap(ret[i],ret[j]);
                return ret;
            }
        }
    }

    s = "00001000";
    for(int i = 4; i < 5; i++){
        for(int j = 5; j < 6; j++){
            string h = s;
            swap(h[i],h[j]);
            if(check_element(h)){
                swap(ret[i],ret[j]);
                return ret;
            }
        }
    }

    s = "00000010";
    for(int i = 6; i < 7; i++){
        for(int j = 7; j < 8; j++){
            string h = s;
            swap(h[i],h[j]);
            if(check_element(h)){
                swap(ret[i],ret[j]);
                return ret;
            }
        }
    }

    cout << "kurac" << endl;
    return {};
}

vector <int> restore_permutation(int N,int W,int R){
    n = N;
    w = W;
    r = R;

    if(n == 8 && w == 256 && r == 256){
        return prvi();
    }
}

Compilation message (stderr)

messy.cpp: In function 'std::vector<int> restore_permutation(int, int, int)':
messy.cpp:117:1: warning: control reaches end of non-void function [-Wreturn-type]
  117 | }
      | ^
#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...