Submission #679131

# Submission time Handle Problem Language Result Execution time Memory
679131 2023-01-07T14:13:35 Z pashka Broken Device (JOI17_broken_device) C++14
0 / 100
45 ms 2628 KB
#include "Annalib.h"

#include<vector>
#include<string>

using namespace std;
const int N = 150;
const int M = 60;
const long long XOR = 0x5341231365237683ll;
const int P[150] = {4, 28, 118, 69, 138, 85, 30, 65, 63, 35, 132, 146, 56, 10, 95, 74, 64, 70, 125, 128, 124, 39, 120,
                    111, 80, 29, 16, 60, 53, 100, 26, 136, 106, 143, 137, 76, 123, 45, 37, 33, 130, 3, 2, 59, 99, 142,
                    145, 97, 68, 83, 127, 58, 38, 1, 62, 114, 43, 101, 22, 141, 103, 131, 110, 18, 61, 49, 115, 0, 5,
                    135, 15, 13, 86, 34, 105, 72, 9, 7, 126, 88, 77, 41, 17, 51, 133, 50, 81, 112, 116, 67, 96, 24, 148,
                    117, 84, 102, 144, 19, 92, 121, 25, 8, 75, 52, 93, 73, 149, 6, 20, 48, 104, 66, 12, 57, 91, 147, 90,
                    82, 98, 27, 21, 139, 129, 108, 44, 31, 89, 134, 14, 87, 32, 71, 55, 122, 23, 79, 36, 109, 78, 113,
                    119, 47, 107, 54, 42, 40, 46, 11, 140, 94};

void Anna(int n, long long x, int k, int p[]) {
    x = x ^ XOR;
    vector<int> res(N);
    string s;
    for (int i = 0; i < 60; i++) {
        s += to_string((x >> i) & 1);
    }

    vector<bool> z(N);
    for (int i = 0; i < k; i++) z[p[i]] = true;

    bool st = false;
    int j = 0;
    for (int i = 0; i < N; i++) {
        if (z[i] || j == (int) s.size()) {
            st = !st;
            continue;
        }
        if ((s[i] == '0' && !st) || (s[i] == '1' && st)) {
            res[i] = 1;
            j++;
        } else {
            st = !st;
        }
    }

    for (int i = 0; i < N; i++) {
        Set(i, res[P[i]]);
    }
}
#include "Brunolib.h"

#include<vector>
#include<string>

using namespace std;
const int N = 150;
const int M = 60;
const long long XOR = 0x5341231365237683ll;
const int P[150] = {4, 28, 118, 69, 138, 85, 30, 65, 63, 35, 132, 146, 56, 10, 95, 74, 64, 70, 125, 128, 124, 39, 120,
                    111, 80, 29, 16, 60, 53, 100, 26, 136, 106, 143, 137, 76, 123, 45, 37, 33, 130, 3, 2, 59, 99, 142,
                    145, 97, 68, 83, 127, 58, 38, 1, 62, 114, 43, 101, 22, 141, 103, 131, 110, 18, 61, 49, 115, 0, 5,
                    135, 15, 13, 86, 34, 105, 72, 9, 7, 126, 88, 77, 41, 17, 51, 133, 50, 81, 112, 116, 67, 96, 24, 148,
                    117, 84, 102, 144, 19, 92, 121, 25, 8, 75, 52, 93, 73, 149, 6, 20, 48, 104, 66, 12, 57, 91, 147, 90,
                    82, 98, 27, 21, 139, 129, 108, 44, 31, 89, 134, 14, 87, 32, 71, 55, 122, 23, 79, 36, 109, 78, 113,
                    119, 47, 107, 54, 42, 40, 46, 11, 140, 94};

long long Bruno(int n, int A[]) {
    vector<int> a(N);
    for (int i = 0; i < N; i++) {
        a[P[i]] = A[i];
    }
    long long x = 0;

    bool st = false;
    int j = 0;
    for (int i = 0; i < N; i++) {
        if (a[i]) {
            x = x | ((int)st << j);
            j++;
        } else {
            st = !st;
        }
    }

    x = x ^ XOR;
    return x;
}
# Verdict Execution time Memory Grader output
1 Partially correct 33 ms 2480 KB Output isn't correct - L* = 0
2 Partially correct 32 ms 2524 KB Output isn't correct - L* = 0
3 Partially correct 38 ms 2488 KB Output isn't correct - L* = 0
4 Partially correct 40 ms 2484 KB Output isn't correct - L* = 0
5 Partially correct 33 ms 2512 KB Output isn't correct - L* = 0
6 Partially correct 38 ms 2628 KB Output isn't correct - L* = 0
7 Partially correct 33 ms 2576 KB Output isn't correct - L* = 0
8 Partially correct 33 ms 2492 KB Output isn't correct - L* = 0
9 Partially correct 34 ms 2600 KB Output isn't correct - L* = 0
10 Partially correct 35 ms 2468 KB Output isn't correct - L* = 0
11 Partially correct 36 ms 2452 KB Output isn't correct - L* = 0
12 Partially correct 33 ms 2508 KB Output isn't correct - L* = 0
13 Partially correct 32 ms 2488 KB Output isn't correct - L* = 0
14 Partially correct 33 ms 2460 KB Output isn't correct - L* = 0
15 Partially correct 33 ms 2484 KB Output isn't correct - L* = 0
16 Partially correct 32 ms 2588 KB Output isn't correct - L* = 0
17 Partially correct 32 ms 2544 KB Output isn't correct - L* = 0
18 Partially correct 33 ms 2464 KB Output isn't correct - L* = 0
19 Partially correct 31 ms 2540 KB Output isn't correct - L* = 0
20 Partially correct 32 ms 2580 KB Output isn't correct - L* = 0
21 Partially correct 33 ms 2608 KB Output isn't correct - L* = 0
22 Partially correct 33 ms 2524 KB Output isn't correct - L* = 0
23 Partially correct 34 ms 2552 KB Output isn't correct - L* = 0
24 Partially correct 44 ms 2436 KB Output isn't correct - L* = 0
25 Partially correct 33 ms 2496 KB Output isn't correct - L* = 0
26 Partially correct 32 ms 2480 KB Output isn't correct - L* = 0
27 Partially correct 32 ms 2500 KB Output isn't correct - L* = 0
28 Partially correct 33 ms 2584 KB Output isn't correct - L* = 0
29 Partially correct 45 ms 2444 KB Output isn't correct - L* = 0
30 Partially correct 41 ms 2488 KB Output isn't correct - L* = 0
31 Partially correct 38 ms 2460 KB Output isn't correct - L* = 0
32 Partially correct 34 ms 2508 KB Output isn't correct - L* = 0
33 Partially correct 33 ms 2560 KB Output isn't correct - L* = 0
34 Partially correct 32 ms 2476 KB Output isn't correct - L* = 0
35 Partially correct 35 ms 2604 KB Output isn't correct - L* = 0
36 Partially correct 37 ms 2424 KB Output isn't correct - L* = 0
37 Partially correct 38 ms 2556 KB Output isn't correct - L* = 0
38 Partially correct 41 ms 2404 KB Output isn't correct - L* = 0
39 Partially correct 33 ms 2464 KB Output isn't correct - L* = 0
40 Partially correct 32 ms 2488 KB Output isn't correct - L* = 0