Submission #72701

# Submission time Handle Problem Language Result Execution time Memory
72701 2018-08-26T16:17:51 Z ikura355 Broken Device (JOI17_broken_device) C++14
51 / 100
83 ms 3984 KB
#include "Annalib.h"
#include<bits/stdc++.h>
using namespace std;

const int maxn = 150 + 5;

int bad[maxn], res[maxn];

void Anna(int N, long long X, int K, int P[]) {
    for(int i=0;i<N;i++) bad[i] = 0;
    for(int i=0;i<K;i++) bad[P[i]] = 1;
    for(int i=0;i<N;i++) res[i] = 0;
    for(int i=0;i<N;i+=3) {
        if(bad[i] + bad[i+1] + bad[i+2] == 0) {
            int val = X%4;
            if(val==0) res[i+1] = 1;
            if(val==1) res[i+1] = 1, res[i+2] = 1;
            if(val==2) res[i] = res[i+2] = 1;
            if(val==3) res[i] = res[i+1] = res[i+2] = 1;
            X /= 4;
        }
        else if(bad[i] + bad[i+1] + bad[i+2] == 1) {
            int val = X%2;
            if(val==0) {
                if(bad[i] || bad[i+1]) res[i+2] = 1;
                if(bad[i+2]) res[i] = res[i+1] = 1;
                X /= 2;
            }
            if(val==1) {
                if(bad[i+1] || bad[i+2]) {
                    res[i] = 1;
                    X /= 2;
                }
            }
        }
    }
    for(int i=0;i<N;i++) Set(i,res[i]);
}
#include "Brunolib.h"
#include<bits/stdc++.h>
using namespace std;

long long Bruno(int N, int A[]) {
    long long ans = 0;
    for(int i=N-3;i>=0;i-=3) {
        int x = A[i], y = A[i+1], z = A[i+2];
        int val = x*4 + y*2 + z;
        if(val==1 || val==6) ans = ans*2;
        if(val==4) ans = ans*2 + 1;
        if(val==2) ans = ans*4;
        if(val==3) ans = ans*4 + 1;
        if(val==5) ans = ans*4 + 2;
        if(val==7) ans = ans*4 + 3;
    }
    return ans;
}
# Verdict Execution time Memory Grader output
1 Partially correct 44 ms 2984 KB Output is partially correct - L* = 20
2 Partially correct 48 ms 3272 KB Output is partially correct - L* = 21
3 Partially correct 56 ms 3416 KB Output is partially correct - L* = 21
4 Partially correct 48 ms 3560 KB Output is partially correct - L* = 22
5 Partially correct 60 ms 3816 KB Output is partially correct - L* = 21
6 Partially correct 50 ms 3816 KB Output is partially correct - L* = 22
7 Partially correct 64 ms 3816 KB Output is partially correct - L* = 20
8 Partially correct 47 ms 3944 KB Output is partially correct - L* = 20
9 Partially correct 54 ms 3944 KB Output is partially correct - L* = 21
10 Partially correct 70 ms 3944 KB Output is partially correct - L* = 21
11 Partially correct 48 ms 3944 KB Output is partially correct - L* = 20
12 Partially correct 54 ms 3944 KB Output is partially correct - L* = 21
13 Partially correct 45 ms 3944 KB Output is partially correct - L* = 21
14 Partially correct 46 ms 3944 KB Output is partially correct - L* = 22
15 Partially correct 51 ms 3944 KB Output is partially correct - L* = 23
16 Partially correct 41 ms 3944 KB Output is partially correct - L* = 21
17 Partially correct 47 ms 3944 KB Output is partially correct - L* = 20
18 Partially correct 47 ms 3944 KB Output is partially correct - L* = 21
19 Partially correct 45 ms 3944 KB Output is partially correct - L* = 22
20 Partially correct 56 ms 3944 KB Output is partially correct - L* = 22
21 Partially correct 56 ms 3944 KB Output is partially correct - L* = 20
22 Partially correct 45 ms 3944 KB Output is partially correct - L* = 21
23 Partially correct 47 ms 3944 KB Output is partially correct - L* = 22
24 Partially correct 83 ms 3944 KB Output is partially correct - L* = 21
25 Partially correct 56 ms 3944 KB Output is partially correct - L* = 22
26 Partially correct 49 ms 3944 KB Output is partially correct - L* = 22
27 Partially correct 64 ms 3944 KB Output is partially correct - L* = 20
28 Partially correct 47 ms 3944 KB Output is partially correct - L* = 23
29 Partially correct 64 ms 3944 KB Output is partially correct - L* = 22
30 Partially correct 49 ms 3984 KB Output is partially correct - L* = 22
31 Partially correct 54 ms 3984 KB Output is partially correct - L* = 21
32 Partially correct 52 ms 3984 KB Output is partially correct - L* = 23
33 Partially correct 55 ms 3984 KB Output is partially correct - L* = 20
34 Partially correct 54 ms 3984 KB Output is partially correct - L* = 20
35 Partially correct 53 ms 3984 KB Output is partially correct - L* = 22
36 Partially correct 64 ms 3984 KB Output is partially correct - L* = 24
37 Partially correct 67 ms 3984 KB Output is partially correct - L* = 20
38 Partially correct 63 ms 3984 KB Output is partially correct - L* = 25
39 Partially correct 59 ms 3984 KB Output is partially correct - L* = 22
40 Partially correct 52 ms 3984 KB Output is partially correct - L* = 21