답안 #100074

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
100074 2019-03-09T08:12:57 Z SomeoneUnknown Broken Device (JOI17_broken_device) C++14
61 / 100
75 ms 3144 KB
#include "Annalib.h"
#include <bits/stdc++.h>
using namespace std;

void Anna( int N, long long X, int K, int P[] ){
    long long xpr = X;
    int pptr = 0;
    for( int i = 0; i < N; i+=3 ){
        //Set( i, 0 );
        int corrcount = 0;
        bool corecorr = false;
        int lm3 = xpr%3;
        while(pptr < K && P[pptr] < i+3){
            if(P[pptr] == i+lm3) corecorr = true;
            corrcount++;
            pptr++;
        }
        if(corrcount>1){
            for(int j = 0; j < 3; j++)
                Set(i+j, 0);
            continue;
        }
        if(corecorr){
            for(int j = 0; j < 3; j++)
                Set(i+j, j!=lm3);
        }else{
            for(int j = 0; j < 3; j++)
                Set(i+j, j==lm3);
        }
        xpr /= 3;
    }
}
#include "Brunolib.h"
#include <bits/stdc++.h>
using namespace std;

long long Bruno( int N, int A[] ){
    //printf("\n");
    long long res = 0;
    int p0 = 0;
    int p1 = 0;
    for(int i = N-3; i >= 0; i-=3){
    int clean = 0;
        for(int j = 0; j < 3; j++){
            if(A[i+j] == 1){
                clean++;
                //printf("-%d %d\n", i+j, clean);
                p1 = j;
            }else{
                p0=j;
            }
        }
        if(clean == 0) continue;
        //printf("%d ", clean);
        if(clean == 1){
            res *= 3;
            res += p1;
        }else{
            res *= 3;
            res += p0;
        }
    //printf("%lld\n", res);
    }
    return res;
}
/*
2
15 14 1
2
15 9 2
0 1
*/
# 결과 실행 시간 메모리 Grader output
1 Partially correct 46 ms 3072 KB Output is partially correct - L* = 26
2 Partially correct 39 ms 2928 KB Output is partially correct - L* = 26
3 Partially correct 40 ms 2920 KB Output is partially correct - L* = 27
4 Partially correct 48 ms 3048 KB Output is partially correct - L* = 25
5 Partially correct 38 ms 3072 KB Output is partially correct - L* = 25
6 Partially correct 53 ms 3016 KB Output is partially correct - L* = 28
7 Partially correct 47 ms 3072 KB Output is partially correct - L* = 26
8 Partially correct 38 ms 3000 KB Output is partially correct - L* = 26
9 Partially correct 75 ms 3056 KB Output is partially correct - L* = 25
10 Partially correct 63 ms 2848 KB Output is partially correct - L* = 26
11 Partially correct 37 ms 2960 KB Output is partially correct - L* = 27
12 Partially correct 44 ms 3056 KB Output is partially correct - L* = 25
13 Partially correct 38 ms 3056 KB Output is partially correct - L* = 26
14 Partially correct 41 ms 3032 KB Output is partially correct - L* = 26
15 Partially correct 39 ms 3144 KB Output is partially correct - L* = 25
16 Partially correct 44 ms 3000 KB Output is partially correct - L* = 25
17 Partially correct 65 ms 3064 KB Output is partially correct - L* = 25
18 Partially correct 44 ms 3056 KB Output is partially correct - L* = 25
19 Partially correct 48 ms 3000 KB Output is partially correct - L* = 25
20 Partially correct 45 ms 3056 KB Output is partially correct - L* = 25
21 Partially correct 42 ms 3072 KB Output is partially correct - L* = 27
22 Partially correct 45 ms 3072 KB Output is partially correct - L* = 25
23 Partially correct 49 ms 3056 KB Output is partially correct - L* = 27
24 Partially correct 45 ms 3072 KB Output is partially correct - L* = 26
25 Partially correct 55 ms 3056 KB Output is partially correct - L* = 25
26 Partially correct 53 ms 3072 KB Output is partially correct - L* = 26
27 Partially correct 46 ms 3000 KB Output is partially correct - L* = 27
28 Partially correct 36 ms 3072 KB Output is partially correct - L* = 26
29 Partially correct 41 ms 3072 KB Output is partially correct - L* = 25
30 Partially correct 36 ms 3128 KB Output is partially correct - L* = 25
31 Partially correct 40 ms 3072 KB Output is partially correct - L* = 27
32 Partially correct 38 ms 3072 KB Output is partially correct - L* = 26
33 Partially correct 36 ms 3072 KB Output is partially correct - L* = 25
34 Partially correct 46 ms 3072 KB Output is partially correct - L* = 25
35 Partially correct 56 ms 2856 KB Output is partially correct - L* = 27
36 Partially correct 37 ms 3056 KB Output is partially correct - L* = 27
37 Partially correct 47 ms 3096 KB Output is partially correct - L* = 25
38 Partially correct 36 ms 3072 KB Output is partially correct - L* = 25
39 Partially correct 48 ms 3072 KB Output is partially correct - L* = 25
40 Partially correct 53 ms 3072 KB Output is partially correct - L* = 26