Submission #753742

# Submission time Handle Problem Language Result Execution time Memory
753742 2023-06-05T20:12:42 Z piOOE Broken Device (JOI17_broken_device) C++17
8 / 100
40 ms 2700 KB
#include "Annalib.h"

void set(int i, int x, int y, int z) {
    Set(i, x), Set(i + 1, y), Set(i + 2, z);
}

void Anna(int N, long long X, int K, int P[]) {
    int used[150]{};

    for (int i = 0; i < K; ++i) {
        used[P[i]] = true;
    }

    for (int i = 0, c = 0; i < N; i += 3) {
        if (c > 60) {
            c = 60;
        }
        if (used[i] + used[i + 1] + used[i + 2] == 0) {
            set(i, 1, X >> c & 1LL, X >> (c + 1) & 1LL);
            c += 2;
        } else if (used[i] + used[i + 1] + used[i + 2] == 1) {
            set(i, 0, X >> c & 1LL, X >> c & 1LL);
            c += 1;
        } else {
            set(i, 0, 0, 0);
        }
    }
}
#include "Brunolib.h"

long long Bruno(int N, int A[]) {
    long long X = 0;

    for (int i = 0, c = 0; i < N; i += 3) {
        if (c > 60) {
            c = 60;
        }
        if (A[i]) {
            X += (A[i + 1] + A[i + 2] * 2LL) << c;
            c += 2;
        } else {
            X += ((long long) (A[i + 1] || A[i + 2])) << c;
            c += 1;
        }
    }

    return X;
}
# Verdict Execution time Memory Grader output
1 Partially correct 26 ms 2492 KB Output is partially correct - L* = 14
2 Partially correct 28 ms 2420 KB Output is partially correct - L* = 14
3 Partially correct 27 ms 2592 KB Output is partially correct - L* = 14
4 Partially correct 27 ms 2476 KB Output is partially correct - L* = 14
5 Partially correct 38 ms 2552 KB Output is partially correct - L* = 14
6 Partially correct 36 ms 2572 KB Output is partially correct - L* = 14
7 Partially correct 28 ms 2596 KB Output is partially correct - L* = 14
8 Partially correct 27 ms 2464 KB Output is partially correct - L* = 14
9 Partially correct 26 ms 2528 KB Output is partially correct - L* = 14
10 Partially correct 28 ms 2636 KB Output is partially correct - L* = 14
11 Partially correct 37 ms 2496 KB Output is partially correct - L* = 14
12 Partially correct 40 ms 2508 KB Output is partially correct - L* = 14
13 Partially correct 33 ms 2420 KB Output is partially correct - L* = 14
14 Partially correct 29 ms 2492 KB Output is partially correct - L* = 14
15 Partially correct 29 ms 2700 KB Output is partially correct - L* = 14
16 Partially correct 27 ms 2484 KB Output is partially correct - L* = 14
17 Partially correct 26 ms 2420 KB Output is partially correct - L* = 14
18 Partially correct 29 ms 2516 KB Output is partially correct - L* = 14
19 Partially correct 28 ms 2572 KB Output is partially correct - L* = 14
20 Partially correct 26 ms 2652 KB Output is partially correct - L* = 14
21 Partially correct 27 ms 2520 KB Output is partially correct - L* = 14
22 Partially correct 27 ms 2448 KB Output is partially correct - L* = 14
23 Partially correct 25 ms 2496 KB Output is partially correct - L* = 14
24 Partially correct 27 ms 2572 KB Output is partially correct - L* = 14
25 Partially correct 28 ms 2628 KB Output is partially correct - L* = 14
26 Partially correct 27 ms 2500 KB Output is partially correct - L* = 14
27 Partially correct 26 ms 2468 KB Output is partially correct - L* = 14
28 Partially correct 30 ms 2464 KB Output is partially correct - L* = 14
29 Partially correct 27 ms 2548 KB Output is partially correct - L* = 14
30 Partially correct 27 ms 2492 KB Output is partially correct - L* = 14
31 Partially correct 32 ms 2544 KB Output is partially correct - L* = 14
32 Partially correct 40 ms 2580 KB Output is partially correct - L* = 14
33 Partially correct 28 ms 2500 KB Output is partially correct - L* = 14
34 Partially correct 31 ms 2680 KB Output is partially correct - L* = 14
35 Partially correct 27 ms 2480 KB Output is partially correct - L* = 14
36 Partially correct 31 ms 2576 KB Output is partially correct - L* = 14
37 Partially correct 28 ms 2584 KB Output is partially correct - L* = 14
38 Partially correct 27 ms 2580 KB Output is partially correct - L* = 14
39 Partially correct 30 ms 2428 KB Output is partially correct - L* = 14
40 Partially correct 30 ms 2556 KB Output is partially correct - L* = 14