답안 #954891

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
954891 2024-03-28T18:59:00 Z Skywk Broken Device (JOI17_broken_device) C++14
0 / 100
1 ms 604 KB
#include "Annalib.h"
#include <bits/stdc++.h>

using namespace std;

void Anna(int N, long long X, int K, int P[]){
    vector<int> A(N), B(N);
    for(int i=0; i<K; i++){
        B[P[i]] = 1;
    }
    for(int i=0, j=0; (1 << j) <= X;){
        if(B[i]){
            i++;
            continue;
        }
        if(B[i + 1]){
            if((X >> j) & 1){
                i += 2;
                continue;
            }
        }
        A[i] = 1;
        A[i + 1] = (X >> j) & 1;
        j++;
        i += 2;
    }
    for(int i=0; i<N; i++){
        Set(i, A[i]);
    }
}
#include "Brunolib.h"

long long Bruno(int N, int A[]){
    long long X = 0;
    int cntBits = 0;
    for(int i=0; i<N; i++){
        if(A[i] == 1){
            cntBits++;
            i++;
        }
    }
    for(int i=0, j=0; j < cntBits;){
        if(A[i]){
            if(A[i + 1]) X += (1LL << j);
            j++;
            i += 2;
        }
        else{
            i++;
        }
    }
    return X;
}
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 604 KB Execution killed with signal 11
2 Runtime error 1 ms 604 KB Execution killed with signal 11
3 Runtime error 1 ms 604 KB Execution killed with signal 11
4 Runtime error 1 ms 604 KB Execution killed with signal 11
5 Runtime error 1 ms 604 KB Execution killed with signal 11
6 Runtime error 1 ms 604 KB Execution killed with signal 11
7 Runtime error 1 ms 604 KB Execution killed with signal 11
8 Runtime error 1 ms 604 KB Execution killed with signal 11
9 Runtime error 1 ms 604 KB Execution killed with signal 11
10 Runtime error 1 ms 604 KB Execution killed with signal 11
11 Runtime error 1 ms 604 KB Execution killed with signal 11
12 Runtime error 1 ms 604 KB Execution killed with signal 11
13 Runtime error 1 ms 604 KB Execution killed with signal 11
14 Runtime error 1 ms 604 KB Execution killed with signal 11
15 Runtime error 1 ms 604 KB Execution killed with signal 11
16 Runtime error 1 ms 604 KB Execution killed with signal 11
17 Runtime error 1 ms 604 KB Execution killed with signal 11
18 Runtime error 1 ms 604 KB Execution killed with signal 11
19 Runtime error 1 ms 604 KB Execution killed with signal 11
20 Runtime error 1 ms 604 KB Execution killed with signal 11
21 Runtime error 1 ms 604 KB Execution killed with signal 11
22 Runtime error 1 ms 604 KB Execution killed with signal 11
23 Runtime error 1 ms 604 KB Execution killed with signal 11
24 Runtime error 1 ms 604 KB Execution killed with signal 11
25 Runtime error 1 ms 604 KB Execution killed with signal 11
26 Runtime error 1 ms 604 KB Execution killed with signal 11
27 Runtime error 1 ms 604 KB Execution killed with signal 11
28 Runtime error 1 ms 604 KB Execution killed with signal 11
29 Runtime error 1 ms 604 KB Execution killed with signal 11
30 Runtime error 1 ms 604 KB Execution killed with signal 11
31 Runtime error 1 ms 604 KB Execution killed with signal 11
32 Runtime error 1 ms 604 KB Execution killed with signal 11
33 Runtime error 1 ms 604 KB Execution killed with signal 11
34 Runtime error 1 ms 604 KB Execution killed with signal 11
35 Runtime error 1 ms 604 KB Execution killed with signal 11
36 Runtime error 1 ms 604 KB Execution killed with signal 11
37 Runtime error 1 ms 604 KB Execution killed with signal 11
38 Runtime error 1 ms 604 KB Execution killed with signal 11
39 Runtime error 1 ms 604 KB Execution killed with signal 11
40 Runtime error 1 ms 604 KB Execution killed with signal 11