답안 #97563

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
97563 2019-02-17T05:48:29 Z silxikys Broken Device (JOI17_broken_device) C++14
0 / 100
70 ms 3312 KB
#include "Annalib.h"
#include <vector>

void Anna(int N, long long X, int K, int P[]) {
    int pos = 0;
    std::vector<int> ans(N,-1);
    for (int i = 0; i < K; i++) {
        ans[P[i]] = 0;
    }
    for (int i = 0; i < N; i += 3) {
        int cnt = (ans[i] == 0) + (ans[i+1] == 0) + (ans[i+2] == 0);
        if (cnt > 1 || pos > 60) {
            ans[i] = 0;
            ans[i+1] = 0;
            ans[i+2] = 0;
        }
        else {
            if ((1LL<<pos) & X) {
                //make it a 1
                if (ans[i] == 0) {
                    ans[i] = 0;
                    ans[i+1] = 1;
                    ans[i+2] = 1;
                }
                else if (ans[i+1] == 0) {
                    ans[i] = 1;
                    ans[i+1] = 0;
                    ans[i+2] = 1;
                }
                else {
                    ans[i] = 1;
                    ans[i+1] = 1;
                    ans[i+2] = 0;
                }
            }
            else {
                //make it a 0
                if (ans[i] == 0) {
                    ans[i] = 0;
                    ans[i+1] = 1;
                    ans[i+2] = 0;
                }
                else if (ans[i+1] == 0) {
                    ans[i] = 0;
                    ans[i+1] = 0;
                    ans[i+2] = 1;
                }
                else {
                    ans[i] = 1;
                    ans[i+1] = 0;
                    ans[i+2] = 0;
                }
            }
            pos++;
        }
    }
    for (int i = 0; i < N; i++) {
        //assert(ans[i] == 0 || ans[i] == 1);
        Set(i,ans[i]);            
    }
}
#include "Brunolib.h"

long long Bruno(int N, int A[]) {
    long long ans = 0;
    long long mult = 1;
    for (int i = 0; i < N; i += 3) {
        int r = A[i]*4 + A[i+1]*2 + A[i+2];
        if (r == 0) continue;
        else if (r == 3 || r == 5 || r == 6) {
            ans += mult;            
        }
        mult *= 2;
    }
    return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 55 ms 3072 KB Output isn't correct - L* = 0
2 Incorrect 46 ms 3072 KB Output isn't correct - L* = 0
3 Incorrect 37 ms 2816 KB Output isn't correct - L* = 0
4 Incorrect 48 ms 2816 KB Output isn't correct - L* = 0
5 Incorrect 38 ms 3024 KB Output isn't correct - L* = 0
6 Incorrect 41 ms 2816 KB Output isn't correct - L* = 0
7 Incorrect 49 ms 2912 KB Output isn't correct - L* = 0
8 Incorrect 41 ms 2816 KB Output isn't correct - L* = 0
9 Incorrect 59 ms 2800 KB Output isn't correct - L* = 0
10 Incorrect 44 ms 2816 KB Output isn't correct - L* = 0
11 Incorrect 38 ms 3072 KB Output isn't correct - L* = 0
12 Incorrect 41 ms 3000 KB Output isn't correct - L* = 0
13 Incorrect 43 ms 2800 KB Output isn't correct - L* = 0
14 Incorrect 70 ms 2800 KB Output isn't correct - L* = 0
15 Incorrect 54 ms 3056 KB Output isn't correct - L* = 0
16 Incorrect 43 ms 3056 KB Output isn't correct - L* = 0
17 Incorrect 57 ms 3056 KB Output isn't correct - L* = 0
18 Incorrect 46 ms 3056 KB Output isn't correct - L* = 0
19 Incorrect 52 ms 3000 KB Output isn't correct - L* = 0
20 Incorrect 54 ms 3056 KB Output isn't correct - L* = 0
21 Incorrect 49 ms 3056 KB Output isn't correct - L* = 0
22 Incorrect 45 ms 2800 KB Output isn't correct - L* = 0
23 Incorrect 56 ms 3072 KB Output isn't correct - L* = 0
24 Incorrect 53 ms 3056 KB Output isn't correct - L* = 0
25 Incorrect 65 ms 3312 KB Output isn't correct - L* = 0
26 Incorrect 49 ms 3072 KB Output isn't correct - L* = 0
27 Incorrect 39 ms 3072 KB Output isn't correct - L* = 0
28 Incorrect 64 ms 3104 KB Output isn't correct - L* = 0
29 Incorrect 59 ms 3056 KB Output isn't correct - L* = 0
30 Incorrect 38 ms 2800 KB Output isn't correct - L* = 0
31 Incorrect 53 ms 3056 KB Output isn't correct - L* = 0
32 Incorrect 39 ms 2816 KB Output isn't correct - L* = 0
33 Incorrect 47 ms 3056 KB Output isn't correct - L* = 0
34 Incorrect 46 ms 3072 KB Output isn't correct - L* = 0
35 Incorrect 45 ms 3056 KB Output isn't correct - L* = 0
36 Incorrect 54 ms 2800 KB Output isn't correct - L* = 0
37 Incorrect 43 ms 3056 KB Output isn't correct - L* = 0
38 Incorrect 55 ms 3312 KB Output isn't correct - L* = 0
39 Incorrect 41 ms 2816 KB Output isn't correct - L* = 0
40 Incorrect 39 ms 2816 KB Output isn't correct - L* = 0