답안 #753507

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
753507 2023-06-05T12:10:12 Z piOOE Broken Device (JOI17_broken_device) C++17
81 / 100
37 ms 2488 KB
#include "Annalib.h"
#include <bits/stdc++.h>

using namespace std;
using ll = long long;

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

void Anna(int N, long long X, int K, int P[]) {
    vector<int> a(N), used(N);
    X ^= Y;

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

    for (int i = 0, b = 0; i < N; ++i) {
        if (!used[p[i]] && (X >> b & 1) == (B[i] - '0')) {
            a[p[i]] = 1;
            b += 1;
        }
    }

    for (int i = 0; i < N; i++) {
        Set(i, a[i]);
    }
}
#include "Brunolib.h"
#include <bits/stdc++.h>

using namespace std;
using ll = long long;

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

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

    for (int i = 0, b = 0; i < N; ++i) {
        if (A[p[i]]) {
            X |= ll(B[i] - '0') << b;
            b += 1;
        }
    }

    X ^= Y;

    return X;
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 32 ms 2276 KB Output is partially correct - L* = 39
2 Partially correct 30 ms 2256 KB Output is partially correct - L* = 39
3 Partially correct 31 ms 2284 KB Output is partially correct - L* = 37
4 Partially correct 34 ms 2336 KB Output is partially correct - L* = 38
5 Partially correct 30 ms 2248 KB Output is partially correct - L* = 39
6 Partially correct 31 ms 2280 KB Output is partially correct - L* = 38
7 Partially correct 30 ms 2488 KB Output is partially correct - L* = 38
8 Partially correct 30 ms 2296 KB Output is partially correct - L* = 37
9 Partially correct 28 ms 2308 KB Output is partially correct - L* = 39
10 Partially correct 35 ms 2236 KB Output is partially correct - L* = 39
11 Correct 28 ms 2340 KB Output is correct - L* = 40
12 Correct 31 ms 2248 KB Output is correct - L* = 40
13 Partially correct 28 ms 2336 KB Output is partially correct - L* = 37
14 Partially correct 32 ms 2244 KB Output is partially correct - L* = 37
15 Partially correct 28 ms 2232 KB Output is partially correct - L* = 38
16 Partially correct 31 ms 2276 KB Output is partially correct - L* = 38
17 Partially correct 37 ms 2216 KB Output is partially correct - L* = 38
18 Partially correct 30 ms 2436 KB Output is partially correct - L* = 38
19 Partially correct 32 ms 2324 KB Output is partially correct - L* = 37
20 Correct 30 ms 2328 KB Output is correct - L* = 40
21 Partially correct 31 ms 2356 KB Output is partially correct - L* = 39
22 Correct 28 ms 2288 KB Output is correct - L* = 40
23 Partially correct 29 ms 2248 KB Output is partially correct - L* = 38
24 Partially correct 35 ms 2232 KB Output is partially correct - L* = 37
25 Partially correct 30 ms 2348 KB Output is partially correct - L* = 39
26 Partially correct 28 ms 2336 KB Output is partially correct - L* = 37
27 Partially correct 30 ms 2248 KB Output is partially correct - L* = 37
28 Partially correct 32 ms 2276 KB Output is partially correct - L* = 39
29 Partially correct 30 ms 2264 KB Output is partially correct - L* = 38
30 Partially correct 31 ms 2248 KB Output is partially correct - L* = 39
31 Partially correct 30 ms 2364 KB Output is partially correct - L* = 38
32 Partially correct 34 ms 2296 KB Output is partially correct - L* = 38
33 Partially correct 31 ms 2228 KB Output is partially correct - L* = 39
34 Partially correct 30 ms 2312 KB Output is partially correct - L* = 39
35 Partially correct 31 ms 2348 KB Output is partially correct - L* = 37
36 Partially correct 33 ms 2328 KB Output is partially correct - L* = 39
37 Partially correct 36 ms 2292 KB Output is partially correct - L* = 38
38 Partially correct 30 ms 2340 KB Output is partially correct - L* = 37
39 Partially correct 31 ms 2288 KB Output is partially correct - L* = 38
40 Partially correct 30 ms 2248 KB Output is partially correct - L* = 35