답안 #753520

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

using namespace std;
using ll = long long;

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

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

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 31 ms 2404 KB Output is partially correct - L* = 37
2 Partially correct 30 ms 2296 KB Output is partially correct - L* = 36
3 Partially correct 30 ms 2328 KB Output is partially correct - L* = 38
4 Partially correct 32 ms 2288 KB Output is partially correct - L* = 37
5 Partially correct 34 ms 2368 KB Output is partially correct - L* = 37
6 Partially correct 32 ms 2220 KB Output is partially correct - L* = 37
7 Partially correct 32 ms 2360 KB Output is partially correct - L* = 38
8 Partially correct 31 ms 2312 KB Output is partially correct - L* = 39
9 Partially correct 30 ms 2320 KB Output is partially correct - L* = 37
10 Partially correct 29 ms 2228 KB Output is partially correct - L* = 37
11 Partially correct 30 ms 2348 KB Output is partially correct - L* = 38
12 Partially correct 33 ms 2320 KB Output is partially correct - L* = 38
13 Partially correct 28 ms 2360 KB Output is partially correct - L* = 37
14 Partially correct 32 ms 2380 KB Output is partially correct - L* = 38
15 Partially correct 30 ms 2256 KB Output is partially correct - L* = 38
16 Partially correct 30 ms 2344 KB Output is partially correct - L* = 38
17 Partially correct 33 ms 2252 KB Output is partially correct - L* = 39
18 Partially correct 34 ms 2220 KB Output is partially correct - L* = 37
19 Correct 28 ms 2324 KB Output is correct - L* = 40
20 Partially correct 31 ms 2288 KB Output is partially correct - L* = 38
21 Partially correct 32 ms 2228 KB Output is partially correct - L* = 38
22 Partially correct 32 ms 2308 KB Output is partially correct - L* = 39
23 Partially correct 33 ms 2244 KB Output is partially correct - L* = 37
24 Partially correct 31 ms 2276 KB Output is partially correct - L* = 37
25 Partially correct 30 ms 2256 KB Output is partially correct - L* = 37
26 Partially correct 33 ms 2284 KB Output is partially correct - L* = 39
27 Partially correct 40 ms 2332 KB Output is partially correct - L* = 38
28 Partially correct 40 ms 2180 KB Output is partially correct - L* = 37
29 Partially correct 31 ms 2312 KB Output is partially correct - L* = 39
30 Partially correct 33 ms 2172 KB Output is partially correct - L* = 39
31 Partially correct 30 ms 2240 KB Output is partially correct - L* = 37
32 Partially correct 36 ms 2248 KB Output is partially correct - L* = 38
33 Partially correct 33 ms 2292 KB Output is partially correct - L* = 37
34 Partially correct 30 ms 2268 KB Output is partially correct - L* = 37
35 Partially correct 31 ms 2272 KB Output is partially correct - L* = 37
36 Partially correct 30 ms 2248 KB Output is partially correct - L* = 38
37 Partially correct 31 ms 2340 KB Output is partially correct - L* = 37
38 Partially correct 41 ms 2304 KB Output is partially correct - L* = 37
39 Partially correct 33 ms 2248 KB Output is partially correct - L* = 39
40 Partially correct 33 ms 2228 KB Output is partially correct - L* = 38