답안 #102635

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
102635 2019-03-26T12:26:55 Z fanache99 Broken Device (JOI17_broken_device) C++14
43 / 100
67 ms 3312 KB
#include "Annalib.h"

const int MAXN = 150;
const int BITS = 60;

int a[MAXN];
bool bad[MAXN];

void Anna(int n, long long x, int k, int p[]){
    for (int i = 0; i < n; i++) {
        bad[i] = false;
        a[i] = 0;
    }
    for (int i = 0; i < k; i++)
        bad[p[i]] = true;
    for (int i = BITS - 1, j = -1; i >= 0; i--) {
        if (x & (1LL << i))
            j += 2;
        else
            j++;
        while (j < n && bad[j])
            j += 2;
        if (j < n)
            a[j] = 1;
    }
    for (int i = 0; i < n; i++)
        Set(i, a[i]);
}

#include "Brunolib.h"

long long Bruno(int n, int a[]) {
    long long answer = 0;
    int bit = 0;
    for (int i = 0; i < n; i++) {
        if (!a[i])
            bit ^= 1;
        else {
            answer = answer * 2 + bit;
            bit = 0;
        }
    }
    return answer;
}

# 결과 실행 시간 메모리 Grader output
1 Partially correct 48 ms 3072 KB Output is partially correct - L* = 29
2 Partially correct 41 ms 3056 KB Output is partially correct - L* = 17
3 Partially correct 46 ms 2816 KB Output is partially correct - L* = 28
4 Partially correct 46 ms 2816 KB Output is partially correct - L* = 18
5 Partially correct 40 ms 3072 KB Output is partially correct - L* = 20
6 Partially correct 38 ms 2800 KB Output is partially correct - L* = 17
7 Partially correct 57 ms 2816 KB Output is partially correct - L* = 23
8 Partially correct 40 ms 2800 KB Output is partially correct - L* = 30
9 Partially correct 51 ms 3056 KB Output is partially correct - L* = 25
10 Partially correct 39 ms 3056 KB Output is partially correct - L* = 28
11 Partially correct 56 ms 3056 KB Output is partially correct - L* = 31
12 Partially correct 46 ms 3000 KB Output is partially correct - L* = 28
13 Partially correct 48 ms 3056 KB Output is partially correct - L* = 28
14 Partially correct 40 ms 2800 KB Output is partially correct - L* = 19
15 Partially correct 43 ms 2816 KB Output is partially correct - L* = 32
16 Partially correct 45 ms 3056 KB Output is partially correct - L* = 18
17 Partially correct 54 ms 2800 KB Output is partially correct - L* = 17
18 Partially correct 67 ms 2800 KB Output is partially correct - L* = 16
19 Partially correct 41 ms 3008 KB Output is partially correct - L* = 19
20 Partially correct 58 ms 3056 KB Output is partially correct - L* = 27
21 Partially correct 56 ms 2824 KB Output is partially correct - L* = 29
22 Partially correct 50 ms 2888 KB Output is partially correct - L* = 25
23 Partially correct 52 ms 3056 KB Output is partially correct - L* = 26
24 Partially correct 49 ms 3312 KB Output is partially correct - L* = 22
25 Partially correct 46 ms 2816 KB Output is partially correct - L* = 16
26 Partially correct 56 ms 2832 KB Output is partially correct - L* = 23
27 Partially correct 50 ms 3056 KB Output is partially correct - L* = 16
28 Partially correct 41 ms 3056 KB Output is partially correct - L* = 30
29 Partially correct 52 ms 2816 KB Output is partially correct - L* = 25
30 Partially correct 45 ms 3312 KB Output is partially correct - L* = 26
31 Partially correct 45 ms 3072 KB Output is partially correct - L* = 32
32 Partially correct 44 ms 3144 KB Output is partially correct - L* = 27
33 Partially correct 43 ms 3072 KB Output is partially correct - L* = 30
34 Partially correct 57 ms 2800 KB Output is partially correct - L* = 26
35 Partially correct 49 ms 3056 KB Output is partially correct - L* = 26
36 Partially correct 53 ms 3056 KB Output is partially correct - L* = 20
37 Partially correct 44 ms 3072 KB Output is partially correct - L* = 16
38 Partially correct 37 ms 2800 KB Output is partially correct - L* = 25
39 Partially correct 41 ms 3056 KB Output is partially correct - L* = 26
40 Partially correct 43 ms 3056 KB Output is partially correct - L* = 25