Submission #1078722

# Submission time Handle Problem Language Result Execution time Memory
1078722 2024-08-28T05:06:26 Z someone Broken Device (JOI17_broken_device) C++14
0 / 100
60 ms 2924 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], id[D];

void insert(i64 x, int idx) {
    for(int i = D-1; i >= 0; i--)
        if(x & (1ll << i)) {
            if(b[i] == 0) {
                b[i] = x;
                id[i] = idx;
                return;
            }
            x ^= b[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; i++) {
        val[i] = rng();
        if(!broken[i]) insert(val[i], i);
    }
    vector<int> ans(N);
    for(int i = D-1; i >= 0; i--) {
        if(X & (1 << i)) {
            X ^= b[i];
            ans[id[i]] = 1;
        }
    }
    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++) {
        int val = rng();
        if(A[i]) X ^= val;
    }
    return X;
}
# Verdict Execution time Memory Grader output
1 Partially correct 43 ms 2756 KB Output isn't correct - L* = 0
2 Partially correct 48 ms 2744 KB Output isn't correct - L* = 0
3 Partially correct 43 ms 2588 KB Output isn't correct - L* = 0
4 Partially correct 42 ms 2676 KB Output isn't correct - L* = 0
5 Partially correct 43 ms 2696 KB Output isn't correct - L* = 0
6 Partially correct 41 ms 2740 KB Output isn't correct - L* = 0
7 Partially correct 41 ms 2776 KB Output isn't correct - L* = 0
8 Partially correct 41 ms 2644 KB Output isn't correct - L* = 0
9 Partially correct 42 ms 2676 KB Output isn't correct - L* = 0
10 Partially correct 43 ms 2676 KB Output isn't correct - L* = 0
11 Partially correct 42 ms 2744 KB Output isn't correct - L* = 0
12 Partially correct 41 ms 2776 KB Output isn't correct - L* = 0
13 Partially correct 44 ms 2680 KB Output isn't correct - L* = 0
14 Partially correct 43 ms 2752 KB Output isn't correct - L* = 0
15 Partially correct 44 ms 2748 KB Output isn't correct - L* = 0
16 Partially correct 41 ms 2576 KB Output isn't correct - L* = 0
17 Partially correct 43 ms 2748 KB Output isn't correct - L* = 0
18 Partially correct 60 ms 2716 KB Output isn't correct - L* = 0
19 Partially correct 44 ms 2680 KB Output isn't correct - L* = 0
20 Partially correct 43 ms 2748 KB Output isn't correct - L* = 0
21 Partially correct 41 ms 2924 KB Output isn't correct - L* = 0
22 Partially correct 44 ms 2856 KB Output isn't correct - L* = 0
23 Partially correct 43 ms 2732 KB Output isn't correct - L* = 0
24 Partially correct 41 ms 2568 KB Output isn't correct - L* = 0
25 Partially correct 42 ms 2756 KB Output isn't correct - L* = 0
26 Partially correct 42 ms 2688 KB Output isn't correct - L* = 0
27 Partially correct 41 ms 2740 KB Output isn't correct - L* = 0
28 Partially correct 41 ms 2744 KB Output isn't correct - L* = 0
29 Partially correct 43 ms 2768 KB Output isn't correct - L* = 0
30 Partially correct 42 ms 2720 KB Output isn't correct - L* = 0
31 Partially correct 43 ms 2740 KB Output isn't correct - L* = 0
32 Partially correct 42 ms 2688 KB Output isn't correct - L* = 0
33 Partially correct 43 ms 2644 KB Output isn't correct - L* = 0
34 Partially correct 43 ms 2740 KB Output isn't correct - L* = 0
35 Partially correct 41 ms 2776 KB Output isn't correct - L* = 0
36 Partially correct 41 ms 2752 KB Output isn't correct - L* = 0
37 Partially correct 42 ms 2656 KB Output isn't correct - L* = 0
38 Partially correct 45 ms 2680 KB Output isn't correct - L* = 0
39 Partially correct 43 ms 2676 KB Output isn't correct - L* = 0
40 Partially correct 42 ms 2696 KB Output isn't correct - L* = 0