답안 #100084

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
100084 2019-03-09T08:19:46 Z dantoh000 Broken Device (JOI17_broken_device) C++14
85 / 100
65 ms 3312 KB
#include "Annalib.h"
#include <bits/stdc++.h>
using namespace std;
void Anna( int N, long long X, int K, int P[] ){
    //printf("anna");
    bool isbroken[N]; memset(isbroken,0,sizeof(isbroken));
    for (int i = 0; i < K; i++){
        isbroken[P[i]] = true;
    }
    int s = 0;
    while (X && s < N){
        if (isbroken[s]||isbroken[s+1]){
            Set(s,0);
            Set(s+1,0);
        }
        else{
            //printf("%d",X%2);
            if (X % 3 == 1){
                Set(s,0);
                Set(s+1,1);
            }
            else if (X % 3 == 2){
                Set(s,1);
                Set(s+1,0);
            }
            else{
                Set(s,1);
                Set(s+1,1);
            }
            X /= 3;
        }
        s+=2;
    }
    for (int i = s; i < N; i++){
        Set(i,0);
    }
    //printf("\n");
}
#include "Brunolib.h"
#include <bits/stdc++.h>
using namespace std;
long long Bruno( int N, int A[] ){
    //printf("bruno");
    long long ans = 0ll;
    int s = 0;
    int num = 0;
    stack<int> st;
    while (s<N){
        if (A[s] || A[s+1]){
            num++;
            //printf("%d",(A[s]^A[e]));
            st.push(A[s]*2+A[s+1]);
        }
        s+=2;
    }
    while (st.size()){
        //printf("%d",st.top());
        ans*=3;
        ans+=(st.top()%3);
        st.pop();
    }
    //printf("\n%lld\n",ans);
    return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 39 ms 3056 KB Output is partially correct - L* = 37
2 Partially correct 52 ms 2992 KB Output is partially correct - L* = 37
3 Partially correct 39 ms 2920 KB Output is partially correct - L* = 37
4 Partially correct 49 ms 3072 KB Output is partially correct - L* = 37
5 Partially correct 41 ms 3072 KB Output is partially correct - L* = 37
6 Partially correct 39 ms 3072 KB Output is partially correct - L* = 37
7 Partially correct 53 ms 3056 KB Output is partially correct - L* = 37
8 Partially correct 38 ms 3072 KB Output is partially correct - L* = 37
9 Partially correct 42 ms 3072 KB Output is partially correct - L* = 37
10 Partially correct 41 ms 3072 KB Output is partially correct - L* = 37
11 Partially correct 49 ms 3056 KB Output is partially correct - L* = 37
12 Partially correct 37 ms 3072 KB Output is partially correct - L* = 37
13 Partially correct 39 ms 3072 KB Output is partially correct - L* = 37
14 Partially correct 39 ms 3056 KB Output is partially correct - L* = 37
15 Partially correct 46 ms 3008 KB Output is partially correct - L* = 37
16 Partially correct 38 ms 3056 KB Output is partially correct - L* = 37
17 Partially correct 45 ms 3056 KB Output is partially correct - L* = 37
18 Partially correct 59 ms 3056 KB Output is partially correct - L* = 37
19 Partially correct 65 ms 3032 KB Output is partially correct - L* = 37
20 Partially correct 41 ms 3056 KB Output is partially correct - L* = 37
21 Partially correct 49 ms 3056 KB Output is partially correct - L* = 37
22 Partially correct 39 ms 3072 KB Output is partially correct - L* = 37
23 Partially correct 48 ms 3104 KB Output is partially correct - L* = 37
24 Partially correct 47 ms 3056 KB Output is partially correct - L* = 37
25 Partially correct 42 ms 3056 KB Output is partially correct - L* = 37
26 Partially correct 46 ms 3072 KB Output is partially correct - L* = 37
27 Partially correct 53 ms 3056 KB Output is partially correct - L* = 37
28 Partially correct 47 ms 3056 KB Output is partially correct - L* = 37
29 Partially correct 41 ms 3000 KB Output is partially correct - L* = 37
30 Partially correct 38 ms 3072 KB Output is partially correct - L* = 37
31 Partially correct 38 ms 3072 KB Output is partially correct - L* = 37
32 Partially correct 37 ms 3064 KB Output is partially correct - L* = 37
33 Partially correct 47 ms 3056 KB Output is partially correct - L* = 37
34 Partially correct 38 ms 3072 KB Output is partially correct - L* = 37
35 Partially correct 41 ms 3312 KB Output is partially correct - L* = 37
36 Partially correct 38 ms 3072 KB Output is partially correct - L* = 37
37 Partially correct 40 ms 3072 KB Output is partially correct - L* = 37
38 Partially correct 38 ms 3072 KB Output is partially correct - L* = 37
39 Partially correct 43 ms 3056 KB Output is partially correct - L* = 37
40 Partially correct 46 ms 3056 KB Output is partially correct - L* = 37