Submission #1099116

# Submission time Handle Problem Language Result Execution time Memory
1099116 2024-10-10T15:12:13 Z thangdz2k7 Broken Device (JOI17_broken_device) C++17
0 / 100
242 ms 2936 KB
#include <bits/stdc++.h>
#define fi first
#define se second
#include "Annalib.h"

using namespace std;

mt19937 rng(145);

const int m = 150, T = 60;

bitset <T> a[m];

long long rnd(long long l, long long r){
    return l + rng() % (r - l + 1);
}

#define Bit(x, i) (x >> i & 1)

void Anna(int N, long long X, int K, int P[]){
    for (int i = 0; i < m; ++ i){
        for (int j = 0; j < T; ++ j) a[i][j] = rnd(0, 1);
    }

    vector <long long> b(m, 0);
    vector <bool> broken(m, 0);
    for (int i = 0; i < K; ++ i) broken[P[i]] = 1;
    for (int i = 0; i < m; ++ i) if (!broken[i]){
        for (int j = 0; j < T; ++ j) if (a[i][j]) b[i] += (1ll << j);
    }

    vector <pair <long long, int>> basis(T, {0, 0});
    for (int i = 0; i < m; ++ i) if (!broken[i]){
        long long x = b[i];
        for (int j = 0; j < T; ++ j) if (Bit(x, j)){
            if (!basis[j].fi) {
                basis[j] = {x, i};
                break;
            }
            x ^= basis[j].fi;
        }
    }

    bitset <m> ans;
    long long x = X;
    for (int j = 0; j < T; ++ j) if (Bit(x, j)){
        ans.set(basis[j].se); x ^= basis[j].fi;
    }
    for (int i = 0; i < m; ++ i) Set(i, ans[i]);
}
#include <bits/stdc++.h>
#include "Brunolib.h"

using namespace std;

mt19937 rng(145);

const int m = 150, T = 60;

bitset <T> a[m];

long long rnd(long long l, long long r){
    return l + rng() % (r - l + 1);
}

long long Bruno(int N, int A[]){
    long long xr = 0;
    for (int i = 0; i < m; ++ i){
        long long b = 0;
        for (int j = 0; j < T; ++ j){
            int a = rnd(0, 1);
            if (a) b += (1ll << j);
        }
        if (A[i]) xr ^= b;
    }
    return xr;
}
# Verdict Execution time Memory Grader output
1 Partially correct 234 ms 2676 KB Output isn't correct - L* = 0
2 Partially correct 235 ms 2644 KB Output isn't correct - L* = 0
3 Partially correct 238 ms 2668 KB Output isn't correct - L* = 0
4 Partially correct 235 ms 2640 KB Output isn't correct - L* = 0
5 Partially correct 239 ms 2760 KB Output isn't correct - L* = 0
6 Partially correct 235 ms 2680 KB Output isn't correct - L* = 0
7 Partially correct 236 ms 2676 KB Output isn't correct - L* = 0
8 Partially correct 239 ms 2756 KB Output isn't correct - L* = 0
9 Partially correct 239 ms 2692 KB Output isn't correct - L* = 0
10 Partially correct 237 ms 2764 KB Output isn't correct - L* = 0
11 Partially correct 240 ms 2676 KB Output isn't correct - L* = 0
12 Partially correct 240 ms 2748 KB Output isn't correct - L* = 0
13 Partially correct 235 ms 2756 KB Output isn't correct - L* = 0
14 Partially correct 236 ms 2752 KB Output isn't correct - L* = 0
15 Partially correct 242 ms 2676 KB Output isn't correct - L* = 0
16 Partially correct 235 ms 2936 KB Output isn't correct - L* = 0
17 Partially correct 236 ms 2676 KB Output isn't correct - L* = 0
18 Partially correct 236 ms 2692 KB Output isn't correct - L* = 0
19 Partially correct 235 ms 2556 KB Output isn't correct - L* = 0
20 Partially correct 235 ms 2772 KB Output isn't correct - L* = 0
21 Partially correct 239 ms 2676 KB Output isn't correct - L* = 0
22 Partially correct 239 ms 2636 KB Output isn't correct - L* = 0
23 Partially correct 240 ms 2676 KB Output isn't correct - L* = 0
24 Partially correct 236 ms 2832 KB Output isn't correct - L* = 0
25 Partially correct 235 ms 2624 KB Output isn't correct - L* = 0
26 Partially correct 236 ms 2684 KB Output isn't correct - L* = 0
27 Partially correct 238 ms 2680 KB Output isn't correct - L* = 0
28 Partially correct 237 ms 2680 KB Output isn't correct - L* = 0
29 Partially correct 241 ms 2544 KB Output isn't correct - L* = 0
30 Partially correct 238 ms 2648 KB Output isn't correct - L* = 0
31 Partially correct 242 ms 2680 KB Output isn't correct - L* = 0
32 Partially correct 242 ms 2664 KB Output isn't correct - L* = 0
33 Partially correct 237 ms 2672 KB Output isn't correct - L* = 0
34 Partially correct 238 ms 2676 KB Output isn't correct - L* = 0
35 Partially correct 237 ms 2760 KB Output isn't correct - L* = 0
36 Partially correct 239 ms 2868 KB Output isn't correct - L* = 0
37 Partially correct 241 ms 2680 KB Output isn't correct - L* = 0
38 Partially correct 235 ms 2640 KB Output isn't correct - L* = 0
39 Partially correct 238 ms 2760 KB Output isn't correct - L* = 0
40 Partially correct 236 ms 2696 KB Output isn't correct - L* = 0