답안 #131563

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
131563 2019-07-17T09:47:41 Z zoooma13 Broken Device (JOI17_broken_device) C++14
0 / 100
3 ms 508 KB
#include "bits/stdc++.h"
#include "Annalib.h"
using namespace std;

void Anna( int N, long long X, int K, int P[] ){
    X = (X<<1)|1;

    vector <bool> bad(N, false);
    for(int i=0; i<K; i++)
        bad[P[i]] = true;

    int len = log2(X)+1;
    for(int i=0; i<N-len+1; i++){
        bool ok = true;
        for(int j=0; j<len; j++)
            if(bool(X&(1LL<<j)) && bad[i+j])
                ok = false;
        if(ok){
            string enc(N ,'0');
            for(int j=0; j<len; j++)
                enc[i+j] ^= bool(X&(1LL<<j));
            for(int i=0; i<N; i++)
                Set(i ,enc[i]=='1');
            return;
        }
    }
    assert(false);
}
#include "bits/stdc++.h"
#include "Brunolib.h"
using namespace std;

long long Bruno( int N, int A[] ){
    int st = find(A ,A+N ,1)-A ,en = st;
    for(int i=st; i<N; i++)
        if(A[i])
            en = i;
    long long X = 0LL;
    for(int i=st+1; i<=en; i++)
        X |= (1LL<<(i-st-1))*A[i];
    return X;
}
# 결과 실행 시간 메모리 Grader output
1 Runtime error 2 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
3 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
4 Runtime error 2 ms 508 KB Execution killed with signal 11 (could be triggered by violating memory limits)
5 Runtime error 2 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
6 Runtime error 2 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
7 Runtime error 2 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
8 Runtime error 2 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
9 Runtime error 2 ms 376 KB Execution killed with signal 11 (could be triggered by violating memory limits)
10 Runtime error 2 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
11 Runtime error 3 ms 372 KB Execution killed with signal 11 (could be triggered by violating memory limits)
12 Runtime error 3 ms 376 KB Execution killed with signal 11 (could be triggered by violating memory limits)
13 Runtime error 2 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
14 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
15 Runtime error 2 ms 508 KB Execution killed with signal 11 (could be triggered by violating memory limits)
16 Runtime error 2 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
17 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
18 Runtime error 2 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
19 Runtime error 2 ms 376 KB Execution killed with signal 11 (could be triggered by violating memory limits)
20 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
21 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
22 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
23 Runtime error 3 ms 376 KB Execution killed with signal 11 (could be triggered by violating memory limits)
24 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
25 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
26 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
27 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
28 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
29 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
30 Runtime error 2 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
31 Runtime error 2 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
32 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
33 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
34 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
35 Runtime error 2 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
36 Runtime error 3 ms 376 KB Execution killed with signal 11 (could be triggered by violating memory limits)
37 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
38 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
39 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
40 Runtime error 2 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)