답안 #131693

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
131693 2019-07-17T12:59:44 Z zoooma13 Broken Device (JOI17_broken_device) C++14
47 / 100
55 ms 3256 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[ord[i]])
            continue;
        bool bit = bool(X&(1LL<<j));
        if(!bit)
        { enc[ord[i]] = 1 ,enc[ord[i+1]] = 0; j++ ,i++; }
        else if(bit && !bad[ord[i+1]])
        { enc[ord[i]] = 1 ,enc[ord[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[ord[i]])
        { X |= (1LL<<j)*A[ord[i+1]]; j++ ,i++; }
    }
    return X;
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 54 ms 3056 KB Output is partially correct - L* = 22
2 Partially correct 54 ms 3056 KB Output is partially correct - L* = 20
3 Partially correct 54 ms 3064 KB Output is partially correct - L* = 22
4 Partially correct 53 ms 3056 KB Output is partially correct - L* = 22
5 Partially correct 54 ms 3232 KB Output is partially correct - L* = 23
6 Partially correct 54 ms 3024 KB Output is partially correct - L* = 21
7 Partially correct 53 ms 3056 KB Output is partially correct - L* = 21
8 Partially correct 53 ms 3056 KB Output is partially correct - L* = 20
9 Partially correct 53 ms 3056 KB Output is partially correct - L* = 19
10 Partially correct 53 ms 3056 KB Output is partially correct - L* = 24
11 Partially correct 53 ms 3056 KB Output is partially correct - L* = 21
12 Partially correct 53 ms 3064 KB Output is partially correct - L* = 22
13 Partially correct 53 ms 3056 KB Output is partially correct - L* = 20
14 Partially correct 53 ms 3016 KB Output is partially correct - L* = 18
15 Partially correct 54 ms 3056 KB Output is partially correct - L* = 22
16 Partially correct 54 ms 3056 KB Output is partially correct - L* = 21
17 Partially correct 53 ms 3056 KB Output is partially correct - L* = 20
18 Partially correct 53 ms 3056 KB Output is partially correct - L* = 22
19 Partially correct 54 ms 3056 KB Output is partially correct - L* = 23
20 Partially correct 54 ms 3056 KB Output is partially correct - L* = 23
21 Partially correct 53 ms 3056 KB Output is partially correct - L* = 21
22 Partially correct 53 ms 2904 KB Output is partially correct - L* = 20
23 Partially correct 53 ms 3056 KB Output is partially correct - L* = 22
24 Partially correct 53 ms 3056 KB Output is partially correct - L* = 21
25 Partially correct 54 ms 3056 KB Output is partially correct - L* = 20
26 Partially correct 55 ms 3056 KB Output is partially correct - L* = 23
27 Partially correct 53 ms 3056 KB Output is partially correct - L* = 22
28 Partially correct 53 ms 3056 KB Output is partially correct - L* = 22
29 Partially correct 53 ms 3032 KB Output is partially correct - L* = 20
30 Partially correct 54 ms 3056 KB Output is partially correct - L* = 22
31 Partially correct 53 ms 3056 KB Output is partially correct - L* = 21
32 Partially correct 53 ms 3056 KB Output is partially correct - L* = 22
33 Partially correct 55 ms 3000 KB Output is partially correct - L* = 20
34 Partially correct 54 ms 3056 KB Output is partially correct - L* = 23
35 Partially correct 54 ms 3056 KB Output is partially correct - L* = 22
36 Partially correct 54 ms 3056 KB Output is partially correct - L* = 22
37 Partially correct 53 ms 3000 KB Output is partially correct - L* = 21
38 Partially correct 54 ms 3056 KB Output is partially correct - L* = 22
39 Partially correct 54 ms 3056 KB Output is partially correct - L* = 22
40 Partially correct 53 ms 3256 KB Output is partially correct - L* = 18