답안 #131560

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
131560 2019-07-17T09:44:32 Z zoooma13 Broken Device (JOI17_broken_device) C++14
0 / 100
4 ms 996 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 Incorrect 4 ms 760 KB Wrong Answer [4]
2 Incorrect 4 ms 888 KB Wrong Answer [4]
3 Incorrect 4 ms 768 KB Wrong Answer [4]
4 Incorrect 4 ms 760 KB Wrong Answer [4]
5 Incorrect 4 ms 760 KB Wrong Answer [4]
6 Incorrect 4 ms 752 KB Wrong Answer [4]
7 Incorrect 4 ms 760 KB Wrong Answer [4]
8 Incorrect 4 ms 888 KB Wrong Answer [4]
9 Incorrect 4 ms 764 KB Wrong Answer [4]
10 Incorrect 4 ms 632 KB Wrong Answer [4]
11 Incorrect 4 ms 628 KB Wrong Answer [4]
12 Incorrect 4 ms 632 KB Wrong Answer [4]
13 Incorrect 4 ms 632 KB Wrong Answer [4]
14 Incorrect 4 ms 856 KB Wrong Answer [4]
15 Incorrect 4 ms 632 KB Wrong Answer [4]
16 Incorrect 4 ms 764 KB Wrong Answer [4]
17 Incorrect 4 ms 632 KB Wrong Answer [4]
18 Incorrect 4 ms 760 KB Wrong Answer [4]
19 Incorrect 4 ms 756 KB Wrong Answer [4]
20 Incorrect 4 ms 760 KB Wrong Answer [4]
21 Incorrect 4 ms 888 KB Wrong Answer [4]
22 Incorrect 4 ms 632 KB Wrong Answer [4]
23 Incorrect 4 ms 760 KB Wrong Answer [4]
24 Incorrect 4 ms 632 KB Wrong Answer [4]
25 Incorrect 4 ms 760 KB Wrong Answer [4]
26 Incorrect 4 ms 760 KB Wrong Answer [4]
27 Incorrect 4 ms 768 KB Wrong Answer [4]
28 Incorrect 4 ms 632 KB Wrong Answer [4]
29 Incorrect 4 ms 632 KB Wrong Answer [4]
30 Incorrect 4 ms 888 KB Wrong Answer [4]
31 Incorrect 4 ms 760 KB Wrong Answer [4]
32 Incorrect 4 ms 760 KB Wrong Answer [4]
33 Incorrect 4 ms 864 KB Wrong Answer [4]
34 Incorrect 4 ms 756 KB Wrong Answer [4]
35 Incorrect 4 ms 856 KB Wrong Answer [4]
36 Incorrect 4 ms 768 KB Wrong Answer [4]
37 Incorrect 4 ms 888 KB Wrong Answer [4]
38 Incorrect 4 ms 888 KB Wrong Answer [4]
39 Incorrect 4 ms 980 KB Wrong Answer [4]
40 Incorrect 4 ms 996 KB Wrong Answer [4]