답안 #204098

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
204098 2020-02-24T10:58:18 Z coldEr66 Broken Device (JOI17_broken_device) C++14
0 / 100
55 ms 3064 KB
#include "Annalib.h"

const int MAXn = 173;
int ok[MAXn],d[MAXn];
void Anna( int N, long long X, int K, int P[] ){
    for (int i=0;i<N;i++) {
        ok[i] = d[i] = 0;
    }
    for (int i=0;i<K;i++) {
        ok[P[i]] = 1;
    }

    for (int i=0;i<N;i+=3) {
        int tmp = d[i] + d[i+1] + d[i+2];
        if (tmp >= 2) continue;
        if (tmp == 1) {
            if (X % 2 == 0) {
                if (ok[i+2]) d[i] = d[i+1] = 1;
                else d[i+2] = 1;
            }
            else {
                if (ok[i]) {
                    if (X % 4 == 2) d[i+1] = 1;
                    else d[i+1] = d[i+2] = 1;
                    X >>= 1;
                }
                else d[i] = 1;
            }
            X >>= 1;
        }
        else {
            if (X % 4 == 0) d[i] = d[i+1] = d[i+2] = 1;
            else if (X % 4 == 1) d[i] = d[i+2] = 1;
            else if (X % 4 == 2) d[i+1] = 1;
            else d[i+1] = d[i+2] = 1;
            X >>= 2;
        }
    }
    for (int i=0;i<N;i++) Set(i, d[i]);
}
#include "Brunolib.h"
#include <algorithm>
using namespace std;
typedef pair<int,int> ii;
#define X first
#define Y second

ii gt(int a,int b,int c){
    int ret = 4*a + 2*b + c;
    if (ret == 0) return ii(1,0);
    if (ret == 1) return ii(2,0);
    if (ret == 2) return ii(4,2);
    if (ret == 3) return ii(4,3);
    if (ret == 4) return ii(2,1);
    if (ret == 5) return ii(4,1);
    if (ret == 6) return ii(2,0);
    if (ret == 7) return ii(4,0);
}
long long Bruno( int N, int A[] ){
    long long ret = 0;
    for (int i=N-3;i>=0;i--) {
        ii tmp = gt(A[i],A[i+1],A[i+2]);
        ret = ret * tmp.X + tmp.Y;
    }
    return ret;
}

Compilation message

Bruno.cpp: In function 'ii gt(int, int, int)':
Bruno.cpp:18:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
# 결과 실행 시간 메모리 Grader output
1 Partially correct 51 ms 3056 KB Output isn't correct - L* = 0
2 Partially correct 50 ms 3056 KB Output isn't correct - L* = 0
3 Partially correct 51 ms 3056 KB Output isn't correct - L* = 0
4 Partially correct 50 ms 3056 KB Output isn't correct - L* = 0
5 Partially correct 51 ms 3064 KB Output isn't correct - L* = 0
6 Partially correct 53 ms 3056 KB Output isn't correct - L* = 0
7 Partially correct 51 ms 3056 KB Output isn't correct - L* = 0
8 Partially correct 51 ms 3056 KB Output isn't correct - L* = 0
9 Partially correct 50 ms 2856 KB Output isn't correct - L* = 0
10 Partially correct 51 ms 3056 KB Output isn't correct - L* = 0
11 Partially correct 50 ms 3056 KB Output isn't correct - L* = 0
12 Partially correct 50 ms 3056 KB Output isn't correct - L* = 0
13 Partially correct 50 ms 3056 KB Output isn't correct - L* = 0
14 Partially correct 50 ms 3056 KB Output isn't correct - L* = 0
15 Partially correct 51 ms 3056 KB Output isn't correct - L* = 0
16 Partially correct 52 ms 3056 KB Output isn't correct - L* = 0
17 Partially correct 50 ms 3056 KB Output isn't correct - L* = 0
18 Partially correct 50 ms 3056 KB Output isn't correct - L* = 0
19 Partially correct 50 ms 2824 KB Output isn't correct - L* = 0
20 Partially correct 52 ms 3056 KB Output isn't correct - L* = 0
21 Partially correct 50 ms 3056 KB Output isn't correct - L* = 0
22 Partially correct 51 ms 3056 KB Output isn't correct - L* = 0
23 Partially correct 50 ms 3056 KB Output isn't correct - L* = 0
24 Partially correct 53 ms 3056 KB Output isn't correct - L* = 0
25 Partially correct 51 ms 3056 KB Output isn't correct - L* = 0
26 Partially correct 51 ms 3056 KB Output isn't correct - L* = 0
27 Partially correct 51 ms 3056 KB Output isn't correct - L* = 0
28 Partially correct 49 ms 3064 KB Output isn't correct - L* = 0
29 Partially correct 51 ms 3056 KB Output isn't correct - L* = 0
30 Partially correct 51 ms 3056 KB Output isn't correct - L* = 0
31 Partially correct 49 ms 3056 KB Output isn't correct - L* = 0
32 Partially correct 51 ms 3056 KB Output isn't correct - L* = 0
33 Partially correct 50 ms 3056 KB Output isn't correct - L* = 0
34 Partially correct 51 ms 3056 KB Output isn't correct - L* = 0
35 Partially correct 53 ms 3056 KB Output isn't correct - L* = 0
36 Partially correct 55 ms 3056 KB Output isn't correct - L* = 0
37 Partially correct 50 ms 3056 KB Output isn't correct - L* = 0
38 Partially correct 49 ms 2968 KB Output isn't correct - L* = 0
39 Partially correct 52 ms 3056 KB Output isn't correct - L* = 0
40 Partially correct 51 ms 3056 KB Output isn't correct - L* = 0