Submission #95724

#TimeUsernameProblemLanguageResultExecution timeMemory
95724jeffUnscrambling a Messy Bug (IOI16_messy)C++14
38 / 100
3 ms384 KiB
#include <bits/stdc++.h>
#include "messy.h"
using namespace std;

set<string> a, b;

vector<int> restore_permutation(int n, int w, int r) {
    if (n == 8 || r == 1024) {
        vector<int> v;
        int i, j;
        string s = "", t;
        for (i = 0; i < n; ++i) v.push_back(-1), s += "0";
        for (i = 0; i < n; ++i) {
            s[i] = '1';
            add_element(s);
        }
        compile_set();
        s = "";
        for (i = 0; i < n; ++i) s += "0";
        for (i = 0; i < n; ++i) {
            for (j = 0; j < n; ++j) if (s[j] == '0') {
                t = s;
                t[j] = '1';
                if (check_element(t)) {
                    v[j] = i;
                    s = t;
                    break;
                }
            }
        }
        return v;
    }
}

Compilation message (stderr)

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