답안 #954873

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

using namespace std;

int vis[200], a[200], p=60, y;

void Anna(int N, long long X, int k, int P[]){
    for(int i=0; i<N; i++)vis[i]=0;
    for(int i=0; i<k; i++){
        vis[P[i]]=-1;
    }
    for(int i=0; i<N-1; i++){
        if(p<0)break;
        if(vis[i]!=0)continue;
        y=(X/(1ll>>p))%2;
        if(y==0){
            a[i]=1;
            vis[i]=vis[i+1]=1;
            p--;
        }
        if(y==1 && vis[i+1]==0){
            a[i]=vis[i]=a[i+1]=vis[i+1]=1;
            p--;
        }
    }
    
    for(int i=0; i<N; i++){
        Set(i,a[i]);
    }
    
    return;
}
#include <bits/stdc++.h>
#include "Brunolib.h"

using namespace std;

long long res=0, p=60, vis[200]; 

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