Submission #530890

# Submission time Handle Problem Language Result Execution time Memory
530890 2022-02-27T04:51:25 Z qwerasdfzxcl Broken Device (JOI17_broken_device) C++14
85 / 100
41 ms 2704 KB
#include "Annalib.h"
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

static int a[] = {129,48,5,4,93,120,79,139,58,46,10,12,20,127,66,147,116,13,16,114,15,69,67,39,52,19,73,98,102,95,128,36,23,1,83,144,2,77,45,68,38,0,86,37,62,122,11,126,14,132,27,113,49,135,30,55,94,104,90,84,108,112,123,137,70,44,75,59,149,56,60,85,78,51,76,143,40,99,57,41,115,8,96,121,134,110,3,74,63,50,101,26,42,118,125,117,61,140,33,35,65,106,25,119,82,124,6,138,103,80,7,107,18,136,28,22,71,64,146,111,88,34,145,47,142,17,9,29,87,133,32,31,89,21,100,131,105,141,97,130,54,43,53,72,109,92,81,24,148,91};

void Anna( int N, long long X, int K, int P[] ){
    bool chk[150] = {0};
    for (int i=0;i<K;i++) chk[P[i]] = 1;
    for (int i=0;i<150;i+=2){
        if (chk[a[i]] || chk[a[i+1]]) {Set(a[i], 0); Set(a[i+1], 0);}
        else {
            if (X%3==0) {Set(a[i], 0); Set(a[i+1], 1);}
            else if (X%3==1) {Set(a[i], 1); Set(a[i+1], 0);}
            else {Set(a[i], 1); Set(a[i+1], 1);}
            X /= 3;
        }
    }
}
#include "Brunolib.h"
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

static int a[] = {129,48,5,4,93,120,79,139,58,46,10,12,20,127,66,147,116,13,16,114,15,69,67,39,52,19,73,98,102,95,128,36,23,1,83,144,2,77,45,68,38,0,86,37,62,122,11,126,14,132,27,113,49,135,30,55,94,104,90,84,108,112,123,137,70,44,75,59,149,56,60,85,78,51,76,143,40,99,57,41,115,8,96,121,134,110,3,74,63,50,101,26,42,118,125,117,61,140,33,35,65,106,25,119,82,124,6,138,103,80,7,107,18,136,28,22,71,64,146,111,88,34,145,47,142,17,9,29,87,133,32,31,89,21,100,131,105,141,97,130,54,43,53,72,109,92,81,24,148,91};

long long Bruno( int N, int A[] ){
    ll ans = 0;
    for (int i=148;i>=0;i-=2){
        if (!A[a[i]] && !A[a[i+1]]) continue;
        ans *= 3;
        if (A[a[i]]==0 && A[a[i+1]]==1) ans += 0;
        else if (A[a[i]]==1 && A[a[i+1]]==0) ans += 1;
        else ans += 2;
    }
    return ans;
}
# Verdict Execution time Memory Grader output
1 Partially correct 32 ms 2540 KB Output is partially correct - L* = 38
2 Partially correct 30 ms 2460 KB Output is partially correct - L* = 38
3 Partially correct 30 ms 2444 KB Output is partially correct - L* = 38
4 Partially correct 28 ms 2476 KB Output is partially correct - L* = 38
5 Partially correct 28 ms 2460 KB Output is partially correct - L* = 39
6 Partially correct 31 ms 2660 KB Output is partially correct - L* = 38
7 Partially correct 31 ms 2512 KB Output is partially correct - L* = 38
8 Partially correct 38 ms 2452 KB Output is partially correct - L* = 38
9 Partially correct 28 ms 2476 KB Output is partially correct - L* = 39
10 Partially correct 32 ms 2600 KB Output is partially correct - L* = 38
11 Partially correct 30 ms 2484 KB Output is partially correct - L* = 38
12 Partially correct 30 ms 2448 KB Output is partially correct - L* = 38
13 Partially correct 31 ms 2584 KB Output is partially correct - L* = 38
14 Partially correct 31 ms 2456 KB Output is partially correct - L* = 39
15 Partially correct 28 ms 2572 KB Output is partially correct - L* = 39
16 Partially correct 31 ms 2500 KB Output is partially correct - L* = 38
17 Partially correct 37 ms 2596 KB Output is partially correct - L* = 38
18 Partially correct 30 ms 2452 KB Output is partially correct - L* = 38
19 Partially correct 30 ms 2540 KB Output is partially correct - L* = 38
20 Partially correct 30 ms 2636 KB Output is partially correct - L* = 39
21 Partially correct 28 ms 2604 KB Output is partially correct - L* = 38
22 Partially correct 31 ms 2484 KB Output is partially correct - L* = 39
23 Partially correct 30 ms 2588 KB Output is partially correct - L* = 38
24 Partially correct 30 ms 2704 KB Output is partially correct - L* = 39
25 Partially correct 34 ms 2504 KB Output is partially correct - L* = 39
26 Partially correct 34 ms 2516 KB Output is partially correct - L* = 39
27 Partially correct 30 ms 2468 KB Output is partially correct - L* = 38
28 Partially correct 30 ms 2452 KB Output is partially correct - L* = 38
29 Partially correct 31 ms 2556 KB Output is partially correct - L* = 38
30 Partially correct 29 ms 2468 KB Output is partially correct - L* = 37
31 Partially correct 28 ms 2440 KB Output is partially correct - L* = 38
32 Partially correct 32 ms 2524 KB Output is partially correct - L* = 38
33 Partially correct 31 ms 2372 KB Output is partially correct - L* = 38
34 Partially correct 33 ms 2480 KB Output is partially correct - L* = 39
35 Partially correct 30 ms 2484 KB Output is partially correct - L* = 38
36 Partially correct 30 ms 2448 KB Output is partially correct - L* = 39
37 Partially correct 31 ms 2496 KB Output is partially correct - L* = 38
38 Partially correct 30 ms 2556 KB Output is partially correct - L* = 38
39 Partially correct 41 ms 2420 KB Output is partially correct - L* = 39
40 Partially correct 34 ms 2488 KB Output is partially correct - L* = 39