답안 #131687

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

void Anna( int N, long long X, int K, int P[] ){
    /*srand(8465554);
    vector <int> ord(N);
    iota(ord.begin() ,ord.end() ,0);
    random_shuffle(ord.begin() ,ord.end());*/

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

    int len = log2(X)+1 ,j = 0;
    vector <bool> enc(N ,0);
    for(int i=0; i<N-1; i++){
        if(bad[i])
            continue;
        bool bit = bool(X&(1LL<<j));
        if(!bit)
        { enc[i] = 1 ,enc[i+1] = 0; j++ ,i++; }
        else if(bit && !bad[i+1])
        { enc[i] = 1 ,enc[i+1] = 1; j++ ,i++; }
        if(j >= len)
            break;
    }
    for(int i=0; i<N; i++)
        Set(i ,enc[i]);
    //assert(false);
}
#include "bits/stdc++.h"
#include "Brunolib.h"
using namespace std;

long long Bruno( int N, int A[] ){
    /*srand(8465554);
    vector <int> ord(N);
    iota(ord.begin() ,ord.end() ,0);
    random_shuffle(ord.begin() ,ord.end());*/

    int j = 0;
    long long X = 0LL;
    for(int i=0; i<N-1; i++){
        if(A[i])
        { X |= (1LL<<j)*A[i+1]; j++ ,i++; }
    }
    return X;
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 41 ms 3568 KB Output is partially correct - L* = 17
2 Partially correct 41 ms 3248 KB Output is partially correct - L* = 16
3 Partially correct 40 ms 3056 KB Output is partially correct - L* = 18
4 Partially correct 41 ms 3320 KB Output is partially correct - L* = 17
5 Partially correct 41 ms 3312 KB Output is partially correct - L* = 17
6 Partially correct 40 ms 3312 KB Output is partially correct - L* = 17
7 Partially correct 40 ms 3568 KB Output is partially correct - L* = 18
8 Partially correct 41 ms 3312 KB Output is partially correct - L* = 18
9 Partially correct 43 ms 3312 KB Output is partially correct - L* = 18
10 Partially correct 41 ms 3312 KB Output is partially correct - L* = 16
11 Partially correct 40 ms 3312 KB Output is partially correct - L* = 17
12 Partially correct 40 ms 3152 KB Output is partially correct - L* = 20
13 Partially correct 43 ms 3312 KB Output is partially correct - L* = 18
14 Partially correct 41 ms 3320 KB Output is partially correct - L* = 18
15 Partially correct 41 ms 3056 KB Output is partially correct - L* = 16
16 Partially correct 41 ms 3320 KB Output is partially correct - L* = 17
17 Partially correct 40 ms 3312 KB Output is partially correct - L* = 17
18 Partially correct 43 ms 3056 KB Output is partially correct - L* = 16
19 Partially correct 40 ms 3312 KB Output is partially correct - L* = 18
20 Partially correct 41 ms 3312 KB Output is partially correct - L* = 15
21 Partially correct 40 ms 3312 KB Output is partially correct - L* = 17
22 Partially correct 43 ms 3312 KB Output is partially correct - L* = 16
23 Partially correct 41 ms 3312 KB Output is partially correct - L* = 15
24 Partially correct 40 ms 3312 KB Output is partially correct - L* = 17
25 Partially correct 41 ms 3120 KB Output is partially correct - L* = 21
26 Partially correct 41 ms 3312 KB Output is partially correct - L* = 16
27 Partially correct 50 ms 3176 KB Output is partially correct - L* = 18
28 Partially correct 41 ms 3312 KB Output is partially correct - L* = 19
29 Partially correct 41 ms 3056 KB Output is partially correct - L* = 16
30 Partially correct 40 ms 3312 KB Output is partially correct - L* = 20
31 Partially correct 41 ms 3312 KB Output is partially correct - L* = 17
32 Partially correct 40 ms 3320 KB Output is partially correct - L* = 18
33 Partially correct 41 ms 3320 KB Output is partially correct - L* = 17
34 Partially correct 40 ms 3608 KB Output is partially correct - L* = 18
35 Partially correct 43 ms 3312 KB Output is partially correct - L* = 16
36 Partially correct 41 ms 3312 KB Output is partially correct - L* = 15
37 Partially correct 41 ms 3312 KB Output is partially correct - L* = 16
38 Partially correct 41 ms 3312 KB Output is partially correct - L* = 18
39 Partially correct 41 ms 3312 KB Output is partially correct - L* = 17
40 Partially correct 41 ms 3312 KB Output is partially correct - L* = 15