답안 #131694

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
131694 2019-07-17T13:01:03 Z zoooma13 Broken Device (JOI17_broken_device) C++14
49 / 100
58 ms 3088 KB
#include "bits/stdc++.h"
#include "Annalib.h"
using namespace std;
 
void Anna( int N, long long X, int K, int P[] ){
    srand(456);
    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(456);
    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* = 21
2 Partially correct 54 ms 3056 KB Output is partially correct - L* = 22
3 Partially correct 54 ms 3000 KB Output is partially correct - L* = 22
4 Partially correct 55 ms 3056 KB Output is partially correct - L* = 22
5 Partially correct 55 ms 3056 KB Output is partially correct - L* = 24
6 Partially correct 54 ms 3056 KB Output is partially correct - L* = 23
7 Partially correct 53 ms 3056 KB Output is partially correct - L* = 22
8 Partially correct 53 ms 3056 KB Output is partially correct - L* = 23
9 Partially correct 54 ms 3064 KB Output is partially correct - L* = 23
10 Partially correct 54 ms 2968 KB Output is partially correct - L* = 26
11 Partially correct 53 ms 3064 KB Output is partially correct - L* = 19
12 Partially correct 53 ms 3056 KB Output is partially correct - L* = 23
13 Partially correct 53 ms 3056 KB Output is partially correct - L* = 22
14 Partially correct 53 ms 3056 KB Output is partially correct - L* = 23
15 Partially correct 54 ms 2832 KB Output is partially correct - L* = 24
16 Partially correct 54 ms 2896 KB Output is partially correct - L* = 23
17 Partially correct 53 ms 3056 KB Output is partially correct - L* = 23
18 Partially correct 53 ms 3056 KB Output is partially correct - L* = 23
19 Partially correct 53 ms 3056 KB Output is partially correct - L* = 23
20 Partially correct 53 ms 3056 KB Output is partially correct - L* = 23
21 Partially correct 58 ms 3056 KB Output is partially correct - L* = 22
22 Partially correct 53 ms 3056 KB Output is partially correct - L* = 23
23 Partially correct 54 ms 3088 KB Output is partially correct - L* = 24
24 Partially correct 54 ms 3056 KB Output is partially correct - L* = 22
25 Partially correct 54 ms 3056 KB Output is partially correct - L* = 22
26 Partially correct 53 ms 3064 KB Output is partially correct - L* = 24
27 Partially correct 53 ms 3056 KB Output is partially correct - L* = 25
28 Partially correct 54 ms 3056 KB Output is partially correct - L* = 23
29 Partially correct 54 ms 3056 KB Output is partially correct - L* = 22
30 Partially correct 54 ms 3056 KB Output is partially correct - L* = 24
31 Partially correct 54 ms 3056 KB Output is partially correct - L* = 20
32 Partially correct 54 ms 2832 KB Output is partially correct - L* = 23
33 Partially correct 53 ms 3056 KB Output is partially correct - L* = 23
34 Partially correct 54 ms 3056 KB Output is partially correct - L* = 24
35 Partially correct 53 ms 3056 KB Output is partially correct - L* = 22
36 Partially correct 54 ms 3056 KB Output is partially correct - L* = 23
37 Partially correct 53 ms 2992 KB Output is partially correct - L* = 23
38 Partially correct 53 ms 3056 KB Output is partially correct - L* = 23
39 Partially correct 53 ms 3056 KB Output is partially correct - L* = 22
40 Partially correct 54 ms 3056 KB Output is partially correct - L* = 23