답안 #109672

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
109672 2019-05-07T10:50:10 Z popovicirobert Broken Device (JOI17_broken_device) C++14
0 / 100
89 ms 3416 KB
#include "Annalib.h"
#include <bits/stdc++.h>

using namespace std;

void Anna( int N, long long X, int K, int P[] ){

    vector <int> arr(N);

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

    vector <int> sol(N, 0);

    for(int i = 0; i < N; i += 3) {

        int a = arr[i], b = arr[i + 1], c = arr[i + 2];

        if(a + b + c > 1) {
            continue;
        }

        if(a + b + c == 0) {

            if((X & 3) == 0) {
                sol[i] = 1;
            }
            else if((X & 3) == 2) {
                sol[i] = sol[i + 2] = 1;
            }
            else if((X & 3) == 1) {
                sol[i + 1] = sol[i + 2] = 1;
            }
            else if((X & 3) == 3) {
                sol[i] = sol[i + 1] = sol[i + 2] = 1;
            }
            X >>= 2;

        }
        else {

            if(b == 0) {

                if(X & 1) {

                    if(c == 0) {
                        sol[i + 2] = 1;
                    }
                    else {
                        sol[i] = sol[i + 1] = 1;
                    }

                }
                else {
                    sol[i + 1] = 1;
                }
                X >>= 1;

            }
            else {

                if((X & 3) == 0) {
                    sol[i] = 1;
                }
                else if((X & 3) == 2) {
                    sol[i] = sol[i + 2] = 1;
                }
                else if((X & 3) == 1) {
                    sol[i + 1] = sol[i + 2] = 1;
                }
                else if((X & 3) == 3) {
                    sol[i] = sol[i + 1] = sol[i + 2] = 1;
                }
                X >>= 2;

            }

        }

    }

    for(i = 0; i < N; i++) {
        Set(i, sol[i]);
    }

}
#include "Brunolib.h"
#include <bits/stdc++.h>
#define ll long long

using namespace std;

long long Bruno( int N, int A[] ){

    ll ans = 0, pw = 1;

    for(int i = 0; i < N; i += 3) {

        int val = A[i] * 4 + A[i + 1] * 2 + A[i + 2];

        if(val == 0) {
            continue;
        }

        if(val == 2) {
            pw *= 2;
            continue;
        }

        if(val == 1 || val == 6) {
            ans += pw;
            pw *= 2;
            continue;
        }

        if(val == 3) {
            ans += pw;
        }
        if(val == 4) {
            ans += 0;
        }
        if(val == 5) {
            ans += pw * 2;
        }
        if(val == 7) {
            ans += 3 * pw;
        }

        pw *= 4;

    }

    return ans;

}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 54 ms 3312 KB Output isn't correct - L* = 0
2 Incorrect 42 ms 3192 KB Output isn't correct - L* = 0
3 Incorrect 56 ms 3416 KB Output isn't correct - L* = 0
4 Incorrect 89 ms 3328 KB Output isn't correct - L* = 0
5 Incorrect 39 ms 3056 KB Output isn't correct - L* = 0
6 Incorrect 64 ms 3312 KB Output isn't correct - L* = 0
7 Incorrect 41 ms 3312 KB Output isn't correct - L* = 0
8 Incorrect 47 ms 3152 KB Output isn't correct - L* = 0
9 Incorrect 84 ms 3072 KB Output isn't correct - L* = 0
10 Incorrect 46 ms 3080 KB Output isn't correct - L* = 0
11 Incorrect 39 ms 3072 KB Output isn't correct - L* = 0
12 Incorrect 39 ms 3328 KB Output isn't correct - L* = 0
13 Incorrect 67 ms 3056 KB Output isn't correct - L* = 0
14 Incorrect 36 ms 3328 KB Output isn't correct - L* = 0
15 Incorrect 40 ms 3328 KB Output isn't correct - L* = 0
16 Incorrect 36 ms 3384 KB Output isn't correct - L* = 0
17 Incorrect 43 ms 3056 KB Output isn't correct - L* = 0
18 Incorrect 36 ms 3072 KB Output isn't correct - L* = 0
19 Incorrect 42 ms 3256 KB Output isn't correct - L* = 0
20 Incorrect 35 ms 3056 KB Output isn't correct - L* = 0
21 Incorrect 35 ms 3328 KB Output isn't correct - L* = 0
22 Incorrect 46 ms 3072 KB Output isn't correct - L* = 0
23 Incorrect 34 ms 3328 KB Output isn't correct - L* = 0
24 Incorrect 39 ms 3056 KB Output isn't correct - L* = 0
25 Incorrect 39 ms 3232 KB Output isn't correct - L* = 0
26 Incorrect 59 ms 3320 KB Output isn't correct - L* = 0
27 Incorrect 38 ms 3328 KB Output isn't correct - L* = 0
28 Incorrect 45 ms 3056 KB Output isn't correct - L* = 0
29 Incorrect 51 ms 3312 KB Output isn't correct - L* = 0
30 Incorrect 53 ms 3072 KB Output isn't correct - L* = 0
31 Incorrect 35 ms 3072 KB Output isn't correct - L* = 0
32 Incorrect 46 ms 3072 KB Output isn't correct - L* = 0
33 Incorrect 35 ms 3312 KB Output isn't correct - L* = 0
34 Incorrect 46 ms 3256 KB Output isn't correct - L* = 0
35 Incorrect 51 ms 3312 KB Output isn't correct - L* = 0
36 Incorrect 66 ms 3072 KB Output isn't correct - L* = 0
37 Incorrect 41 ms 3312 KB Output isn't correct - L* = 0
38 Incorrect 57 ms 3312 KB Output isn't correct - L* = 0
39 Incorrect 50 ms 3312 KB Output isn't correct - L* = 0
40 Incorrect 43 ms 3312 KB Output isn't correct - L* = 0