답안 #131769

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


pair<int ,int> en(int num){
    if(num == 2) return {1 ,1};
    if(num == 1) return {1 ,0};
    return {0 ,1};
}

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

    mt19937 rng(69);
    X ^= uniform_int_distribution<long long>(1, 1e18)(rng);

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

    vector <bool> enc(N);
    for(int i=0; i<N; i+=2){
        auto d = en(X%3);
        if((!bad[ord[i]] || !d.first) && (!bad[ord[i+1]] || !d.second)){
            enc[ord[i]] = d.first;
            enc[ord[i+1]] = d.second;
            X /= 3;
        }
    }

    for(int i=0; i<N; i++)
        Set(i ,enc[i]);
}
#include "bits/stdc++.h"
#include "Brunolib.h"
using namespace std;

int de(pair<int ,int> p){
    return p.first+p.second == 2 ? 2 : p.first;
}

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

    long long X = 0LL ,pw = 1LL;
    for(int i=0; i<N; i+=2)
        if(A[ord[i]] || A[ord[i+1]]){
            X += pw*de({A[ord[i]] ,A[ord[i+1]]});
            pw *= 3;
        }

    mt19937 rng(69);
    X ^= uniform_int_distribution<long long>(1, 1e18)(rng);

    return X;
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 52 ms 3064 KB Output is partially correct - L* = 37
2 Partially correct 50 ms 3056 KB Output is partially correct - L* = 37
3 Partially correct 50 ms 2896 KB Output is partially correct - L* = 37
4 Partially correct 50 ms 2992 KB Output is partially correct - L* = 37
5 Partially correct 51 ms 3056 KB Output is partially correct - L* = 37
6 Partially correct 51 ms 3056 KB Output is partially correct - L* = 37
7 Partially correct 52 ms 3056 KB Output is partially correct - L* = 37
8 Partially correct 51 ms 3000 KB Output is partially correct - L* = 37
9 Partially correct 50 ms 3056 KB Output is partially correct - L* = 37
10 Partially correct 50 ms 3056 KB Output is partially correct - L* = 37
11 Partially correct 50 ms 3056 KB Output is partially correct - L* = 37
12 Partially correct 51 ms 2904 KB Output is partially correct - L* = 37
13 Partially correct 51 ms 3056 KB Output is partially correct - L* = 37
14 Partially correct 51 ms 3008 KB Output is partially correct - L* = 37
15 Partially correct 51 ms 2952 KB Output is partially correct - L* = 37
16 Partially correct 50 ms 2976 KB Output is partially correct - L* = 37
17 Partially correct 51 ms 2888 KB Output is partially correct - L* = 37
18 Partially correct 50 ms 3056 KB Output is partially correct - L* = 37
19 Partially correct 50 ms 3056 KB Output is partially correct - L* = 37
20 Partially correct 51 ms 2864 KB Output is partially correct - L* = 37
21 Partially correct 50 ms 3056 KB Output is partially correct - L* = 37
22 Partially correct 50 ms 2848 KB Output is partially correct - L* = 37
23 Partially correct 51 ms 2936 KB Output is partially correct - L* = 37
24 Partially correct 51 ms 3056 KB Output is partially correct - L* = 37
25 Partially correct 52 ms 2944 KB Output is partially correct - L* = 37
26 Partially correct 50 ms 2928 KB Output is partially correct - L* = 37
27 Partially correct 52 ms 2896 KB Output is partially correct - L* = 37
28 Partially correct 50 ms 3000 KB Output is partially correct - L* = 37
29 Partially correct 51 ms 3072 KB Output is partially correct - L* = 37
30 Partially correct 51 ms 3208 KB Output is partially correct - L* = 37
31 Partially correct 53 ms 3056 KB Output is partially correct - L* = 37
32 Partially correct 52 ms 3056 KB Output is partially correct - L* = 37
33 Partially correct 51 ms 3056 KB Output is partially correct - L* = 37
34 Partially correct 51 ms 3056 KB Output is partially correct - L* = 37
35 Partially correct 50 ms 3056 KB Output is partially correct - L* = 37
36 Partially correct 51 ms 3056 KB Output is partially correct - L* = 37
37 Partially correct 51 ms 3056 KB Output is partially correct - L* = 37
38 Partially correct 50 ms 3056 KB Output is partially correct - L* = 37
39 Partially correct 50 ms 3056 KB Output is partially correct - L* = 37
40 Partially correct 51 ms 2816 KB Output is partially correct - L* = 37