답안 #754114

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
754114 2023-06-06T17:59:20 Z piOOE Broken Device (JOI17_broken_device) C++17
0 / 100
40 ms 2632 KB
#include "Annalib.h"

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 = N - 3; i >= 0; i -= 3) {
        int a = 0, b = 0, c = 0;

        if (used[i] + used[i + 1] + used[i + 2] == 0) {
            if (x % 4 == 0) {
                b = 1;
            } else if (x % 4 == 1) {
                a = c = 1;
            } else if (x % 4 == 2) {
                a = b = 1;
            } else {
                a = b = c = 1;
            }
            x /= 4;
        } else if (used[i] + used[i + 1] + used[i + 2] == 1) {
            if (x % 2 == 0) {
                if (!used[i + 2]) {
                    c = 1;
                } else {
                    a = bool(x % 4), b = 1;
                    x /= 2;
                }
            } else if (used[i]) {
                b = c = 1;
            } else {
                a = 1;
            }
            x /= 2;
        }

        Set(i, a), Set(i + 1, b), Set(i + 2, c);
    }
}
#include "Brunolib.h"

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

    for (int i = 0; i < N; i += 3) {
        switch (A[i] * 4 + A[i + 1] * 2 + A[i + 2]) {
            case 1: {x = x * 2; break;}
            case 2: {x = x * 4; break;}
            case 3: {x = x * 2 + 1; break;}
            case 4: {x = x * 2 + 1; break;}
            case 5: {x = x * 4 + 2; break;}
            case 6: {x = x * 4 + 1; break;}
            case 7: {x = x * 4 + 3;break;}
        }
    }

    return x;
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 31 ms 2568 KB Output isn't correct - L* = 0
2 Partially correct 30 ms 2448 KB Output isn't correct - L* = 0
3 Partially correct 26 ms 2628 KB Output isn't correct - L* = 0
4 Partially correct 31 ms 2528 KB Output isn't correct - L* = 0
5 Partially correct 32 ms 2620 KB Output isn't correct - L* = 0
6 Partially correct 28 ms 2560 KB Output isn't correct - L* = 0
7 Partially correct 30 ms 2632 KB Output isn't correct - L* = 0
8 Partially correct 37 ms 2440 KB Output isn't correct - L* = 0
9 Partially correct 28 ms 2520 KB Output isn't correct - L* = 0
10 Partially correct 29 ms 2540 KB Output isn't correct - L* = 0
11 Partially correct 33 ms 2596 KB Output isn't correct - L* = 0
12 Partially correct 27 ms 2508 KB Output isn't correct - L* = 0
13 Partially correct 29 ms 2552 KB Output isn't correct - L* = 0
14 Partially correct 29 ms 2432 KB Output isn't correct - L* = 0
15 Partially correct 33 ms 2452 KB Output isn't correct - L* = 0
16 Partially correct 26 ms 2548 KB Output isn't correct - L* = 0
17 Partially correct 27 ms 2484 KB Output isn't correct - L* = 0
18 Partially correct 26 ms 2504 KB Output isn't correct - L* = 0
19 Partially correct 26 ms 2528 KB Output isn't correct - L* = 0
20 Partially correct 28 ms 2524 KB Output isn't correct - L* = 0
21 Partially correct 26 ms 2524 KB Output isn't correct - L* = 0
22 Partially correct 27 ms 2496 KB Output isn't correct - L* = 0
23 Partially correct 28 ms 2480 KB Output isn't correct - L* = 0
24 Partially correct 27 ms 2496 KB Output isn't correct - L* = 0
25 Partially correct 28 ms 2516 KB Output isn't correct - L* = 0
26 Partially correct 31 ms 2412 KB Output isn't correct - L* = 0
27 Partially correct 29 ms 2592 KB Output isn't correct - L* = 0
28 Partially correct 27 ms 2532 KB Output isn't correct - L* = 0
29 Partially correct 30 ms 2488 KB Output isn't correct - L* = 0
30 Partially correct 26 ms 2576 KB Output isn't correct - L* = 0
31 Partially correct 34 ms 2476 KB Output isn't correct - L* = 0
32 Partially correct 28 ms 2592 KB Output isn't correct - L* = 0
33 Partially correct 26 ms 2552 KB Output isn't correct - L* = 0
34 Partially correct 27 ms 2412 KB Output isn't correct - L* = 0
35 Partially correct 29 ms 2492 KB Output isn't correct - L* = 0
36 Partially correct 28 ms 2532 KB Output isn't correct - L* = 0
37 Partially correct 28 ms 2496 KB Output isn't correct - L* = 0
38 Partially correct 40 ms 2604 KB Output isn't correct - L* = 0
39 Partially correct 40 ms 2420 KB Output isn't correct - L* = 0
40 Partially correct 32 ms 2468 KB Output isn't correct - L* = 0