Submission #1078743

# Submission time Handle Problem Language Result Execution time Memory
1078743 2024-08-28T05:35:10 Z someone Broken Device (JOI17_broken_device) C++14
0 / 100
2 ms 856 KB
#include "Annalib.h"
#include <bits/stdc++.h>
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
using i64 = long long;
using namespace std;

const int D = 60;

i64 b[D];
bitset<150> id[D];

void insert(i64 x, int idx) {
    bitset<150> act;
    act[idx] = 1;
    for(int i = D-1; i >= 0; i--)
        if(x & (1ll << i)) {
            if(b[i] == 0) {
                b[i] = x;
                id[i] = act;
                return;
            }
            x ^= b[i];
            act ^= id[i];
        }
}

void Anna(int N, long long X, int K, int P[]) {
    for(int i = 0; i < D; i++) b[i] = 0;
    vector<int> broken(N);
    for(int i = 0; i < K; i++)
        broken[P[i]] = 1;

    mt19937_64 rng(42);
    vector<i64> val(N);
    for(int i = 0; i < N-K+10; i++) {
        val[i] = rng() & ((1ll << 60) - 1);
        if(!broken[i]) insert(val[i], i);
    }
    bitset<150> ans;
    for(int i = D-1; i >= 0; i--) {
        if(X & (1ll << i)) {
            X ^= b[i];
            ans ^= id[i];
        }
    }
    for(int i = 0; i < N; i++)
        Set(i, ans[i]);
}
#include "Brunolib.h"
#include <bits/stdc++.h>
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
using i64 = long long;
using namespace std;


long long Bruno( int N, int A[] ){
    mt19937_64 rng(42);
    i64 X = 0;
    for(int i = 0; i < N; i++) {
        i64 val = rng() & ((1ll << 60) - 1);
        if(A[i]) X ^= val;
    }
    return X;
}
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 604 KB Execution killed with signal 6
2 Runtime error 1 ms 604 KB Execution killed with signal 6
3 Runtime error 1 ms 604 KB Execution killed with signal 6
4 Runtime error 1 ms 452 KB Execution killed with signal 6
5 Runtime error 1 ms 604 KB Execution killed with signal 6
6 Runtime error 1 ms 604 KB Execution killed with signal 6
7 Runtime error 1 ms 604 KB Execution killed with signal 6
8 Runtime error 1 ms 604 KB Execution killed with signal 6
9 Runtime error 1 ms 604 KB Execution killed with signal 6
10 Runtime error 1 ms 604 KB Execution killed with signal 6
11 Runtime error 1 ms 452 KB Execution killed with signal 6
12 Runtime error 1 ms 600 KB Execution killed with signal 6
13 Runtime error 1 ms 604 KB Execution killed with signal 6
14 Runtime error 1 ms 604 KB Execution killed with signal 6
15 Runtime error 2 ms 604 KB Execution killed with signal 6
16 Runtime error 1 ms 604 KB Execution killed with signal 6
17 Runtime error 1 ms 604 KB Execution killed with signal 6
18 Runtime error 1 ms 604 KB Execution killed with signal 6
19 Runtime error 1 ms 604 KB Execution killed with signal 6
20 Runtime error 1 ms 856 KB Execution killed with signal 6
21 Runtime error 2 ms 604 KB Execution killed with signal 6
22 Runtime error 1 ms 604 KB Execution killed with signal 6
23 Runtime error 1 ms 600 KB Execution killed with signal 6
24 Runtime error 1 ms 604 KB Execution killed with signal 6
25 Runtime error 1 ms 604 KB Execution killed with signal 6
26 Runtime error 1 ms 600 KB Execution killed with signal 6
27 Runtime error 1 ms 604 KB Execution killed with signal 6
28 Runtime error 1 ms 600 KB Execution killed with signal 6
29 Runtime error 2 ms 604 KB Execution killed with signal 6
30 Runtime error 1 ms 456 KB Execution killed with signal 6
31 Runtime error 1 ms 604 KB Execution killed with signal 6
32 Runtime error 1 ms 604 KB Execution killed with signal 6
33 Runtime error 1 ms 604 KB Execution killed with signal 6
34 Runtime error 1 ms 456 KB Execution killed with signal 6
35 Runtime error 1 ms 600 KB Execution killed with signal 6
36 Runtime error 1 ms 604 KB Execution killed with signal 6
37 Runtime error 1 ms 604 KB Execution killed with signal 6
38 Runtime error 1 ms 604 KB Execution killed with signal 6
39 Runtime error 0 ms 604 KB Execution killed with signal 6
40 Runtime error 2 ms 604 KB Execution killed with signal 6