Submission #853665

# Submission time Handle Problem Language Result Execution time Memory
853665 2023-09-25T00:46:03 Z hgmhc Unscrambling a Messy Bug (IOI16_messy) C++17
0 / 100
1 ms 348 KB
#include "messy.h"
#include <bits/stdc++.h>
using namespace std; using ii = pair<int,int>; using ll = long long; using vi = vector<int>;
#define rep(i,a,b) for (auto i = (a); i <= (b); ++i)
#define per(i,a,b) for (auto i = (b); i >= (a); --i)
#define all(x) begin(x), end(x)
#define siz(x) int((x).size())
#define Mup(x,y) x = max(x,y)
#define mup(x,y) x = min(x,y)
#define fi first
#define se second
#define dbg(...) fprintf(stderr,__VA_ARGS__)

vi restore_permutation(int n, int w, int r) {
    assert(n==8);
    rep(i,1,8) {
        add_element(string(n-i,'0')+string(i,'1'));
    }
    compile_set();
    vi p(n); iota(all(p),0);
    vi idx;
    rep(i,1,8) {
        if (!check_element(string(n-i,'0')+string(i,'1'))) {
            idx.push_back(n-i);
        }
    }
    swap(p[idx[0]],p[idx[0]-siz(idx)]);
    return p;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB n = 8
2 Correct 0 ms 348 KB n = 8
3 Correct 0 ms 348 KB n = 8
4 Correct 0 ms 348 KB n = 8
5 Correct 0 ms 348 KB n = 8
6 Correct 0 ms 348 KB n = 8
7 Runtime error 1 ms 348 KB Execution killed with signal 11
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 348 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 348 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 348 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 348 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -