답안 #448144

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
448144 2021-07-29T03:35:44 Z JovanB Broken Device (JOI17_broken_device) C++17
0 / 100
46 ms 2536 KB
#include "Annalib.h"
#include <bits/stdc++.h>

using namespace std;

using ll = long long;

static const ll K = 626237348924392349LL;

static int radi[1005];

static int ord[] = {24, 2, 18, 98, 0, 54, 116, 144, 58, 90, 36, 124, 64, 80, 142, 102, 52, 82, 96, 34, 16, 94, 128, 132, 130, 14, 12, 22, 10, 8, 4, 104, 108, 70, 112, 78, 50, 6, 86, 32, 122, 136, 28, 26, 48, 110, 126, 38, 40, 118, 20, 66, 42, 56, 148, 30, 100, 68, 72, 88, 106, 76, 92, 120, 134, 60, 114, 44, 74, 46, 140, 138, 62, 84, 146};

void Anna(int _n, long long X, int _k, int P[] ){
    int n = _n;
    int k = _k;
    for(int i=0; i<n; i++) radi[i] = 1;
    for(int i=0; i<k; i++) radi[P[i]] = 0;
    if(k > 38){
        for(int i=0; i<n; i++) Set(i, 1);
        return;
    }
    X ^= K;
    int j = 0;
    for(int i=0; i<38; i++){
        int treba = X%3;
        X /= 3;
        treba++;
        for(;;){
            if(treba/2 <= radi[ord[j]] && treba%2 <= radi[ord[j]+1]){
                Set(ord[j], treba/2);
                Set(ord[j]+1, treba%2);
                j++;
                break;
            }
            Set(ord[j], 0);
            Set(ord[j]+1, 0);
            j++;
        }
    }
    while(j < n/2){
        Set(ord[j], 0);
        Set(ord[j]+1, 0);
        j++;
    }
}
#include "Brunolib.h"
#include <bits/stdc++.h>

using namespace std;

using ll = long long;

static const ll K = 626237348924392349LL;

static int ord[] = {24, 2, 18, 98, 0, 54, 116, 144, 58, 90, 36, 124, 64, 80, 142, 102, 52, 82, 96, 34, 16, 94, 128, 132, 130, 14, 12, 22, 10, 8, 4, 104, 108, 70, 112, 78, 50, 6, 86, 32, 122, 136, 28, 26, 48, 110, 126, 38, 40, 118, 20, 66, 42, 56, 148, 30, 100, 68, 72, 88, 106, 76, 92, 120, 134, 60, 114, 44, 74, 46, 140, 138, 62, 84, 146};

long long Bruno( int N, int A[] ){
    int j = 0;
    ll p3 = 1;
    ll res = 0;
    for(int i=0; i<38; i++){
        int tr;
        for(;;){
            tr = 2*A[ord[j]] + A[ord[j]+1];
            j++;
            if(tr) break;
        }
        res += (tr-1)*p3;
        p3 *= 3;
    }
    return res ^ K;
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 38 ms 2272 KB Output is partially correct - L* = 38
2 Partially correct 38 ms 2284 KB Output is partially correct - L* = 38
3 Partially correct 38 ms 2212 KB Output is partially correct - L* = 38
4 Partially correct 38 ms 2396 KB Output is partially correct - L* = 38
5 Partially correct 39 ms 2536 KB Output is partially correct - L* = 38
6 Partially correct 40 ms 2204 KB Output is partially correct - L* = 38
7 Partially correct 38 ms 2252 KB Output is partially correct - L* = 38
8 Partially correct 38 ms 2292 KB Output is partially correct - L* = 38
9 Partially correct 45 ms 2228 KB Output is partially correct - L* = 38
10 Partially correct 38 ms 2220 KB Output is partially correct - L* = 38
11 Partially correct 38 ms 2276 KB Output is partially correct - L* = 38
12 Partially correct 40 ms 2396 KB Output is partially correct - L* = 38
13 Partially correct 38 ms 2312 KB Output is partially correct - L* = 38
14 Partially correct 38 ms 2204 KB Output is partially correct - L* = 38
15 Partially correct 38 ms 2312 KB Output is partially correct - L* = 38
16 Partially correct 46 ms 2348 KB Output is partially correct - L* = 38
17 Incorrect 5 ms 1132 KB Wrong Answer [2]
18 Partially correct 38 ms 2224 KB Output is partially correct - L* = 38
19 Partially correct 39 ms 2196 KB Output is partially correct - L* = 38
20 Partially correct 38 ms 2376 KB Output is partially correct - L* = 38
21 Partially correct 38 ms 2336 KB Output is partially correct - L* = 38
22 Partially correct 38 ms 2268 KB Output is partially correct - L* = 38
23 Partially correct 38 ms 2348 KB Output is partially correct - L* = 38
24 Partially correct 39 ms 2224 KB Output is partially correct - L* = 38
25 Partially correct 38 ms 2224 KB Output is partially correct - L* = 38
26 Partially correct 38 ms 2148 KB Output is partially correct - L* = 38
27 Partially correct 43 ms 2336 KB Output is partially correct - L* = 38
28 Partially correct 40 ms 2268 KB Output is partially correct - L* = 38
29 Partially correct 38 ms 2204 KB Output is partially correct - L* = 38
30 Partially correct 38 ms 2324 KB Output is partially correct - L* = 38
31 Partially correct 38 ms 2336 KB Output is partially correct - L* = 38
32 Partially correct 39 ms 2204 KB Output is partially correct - L* = 38
33 Partially correct 39 ms 2156 KB Output is partially correct - L* = 38
34 Partially correct 40 ms 2280 KB Output is partially correct - L* = 38
35 Partially correct 38 ms 2268 KB Output is partially correct - L* = 38
36 Partially correct 38 ms 2444 KB Output is partially correct - L* = 38
37 Partially correct 38 ms 2204 KB Output is partially correct - L* = 38
38 Partially correct 38 ms 2204 KB Output is partially correct - L* = 38
39 Partially correct 38 ms 2196 KB Output is partially correct - L* = 38
40 Partially correct 40 ms 2308 KB Output is partially correct - L* = 38