Submission #26859

# Submission time Handle Problem Language Result Execution time Memory
26859 2017-07-06T10:55:38 Z wangyenjen Broken Device (JOI17_broken_device) C++14
0 / 100
65 ms 4640 KB
/// Author: Wang, Yen-Jen
#include "Annalib.h"
#include <bits/stdc++.h>

using namespace std;

static bool A[150];
static bool B[150];
static int cnt[50];
static bool st[150];

inline static void my_set(int p , int a , int b , int c) {
    B[p * 3] = a;
    B[p * 3 + 1] = b;
    B[p * 3 + 2] = c;
}

void Anna(int N , long long X , int K , int P[]) {
    memset(st , 0 , sizeof(st));
    memset(cnt , 0 , sizeof(cnt));
    for(int i = 0; i < K; i++) {
        st[P[i]] = 1;
        cnt[P[i] / 3]++;
    }
    memset(A , 0 , sizeof(A));
    for(int i = 0; i < 60; i++) {
        A[i] = (X&1);
        X >>= 1;
    }
    int cc = 0;
    memset(B , 0 , sizeof(B));
    for(int i = 0; i < N / 3; i++) {
        if(cnt[i] >= 2) continue;
        if(cnt[i] == 0) {
            if(A[cc]) {
                if(A[cc + 1]) my_set(i , 1 , 1 , 1);
                else my_set(i , 0 , 1 , 1);
            }
            else {
                if(A[cc + 1]) my_set(i , 1 , 0 , 1);
                else my_set(i , 1 , 0 , 0);
            }
            cc += 2;
        }
        else {
            if(st[i * 3]) {
                if(A[cc]) my_set(i , 0 , 0 , 1);
                else my_set(i , 0 , 1 , 0);
                cc++;

            }
            else if(st[i * 3 + 1]) {
                if(A[cc]) {
                    my_set(i , 0 , 0 , 1);
                    cc++;
                }
                else if(!A[cc] && !A[cc + 1]) {
                    my_set(i , 1 , 0 , 1);
                    cc += 2;
                }
                else {
                    my_set(i , 1 , 0 , 0);
                    cc += 2;
                }
            }
            else {
                if(A[cc]) {
                    my_set(i , 1 , 1 , 0);
                    cc++;
                }
                else {
                    my_set(i , 0 , 1 , 0);
                    cc++;
                }
            }
        }
    }
    for(int i = 0; i < N; i++) Set(i , B[i]);
}
/// Author: Wang, Yen-Jen
#include "Brunolib.h"
#include <bits/stdc++.h>

using namespace std;

static int B[150];

long long Bruno(int N , int A[]) {
    long long X = 0;
    int cc = 0;
    for(int i = 0; i < N / 3; i++) {
        if(!(A[i * 3] || A[i * 3 + 1] || A[i * 3 + 2])) continue;
        if(A[i * 3]) {
            if(A[i * 3 + 1]) {
                if(A[i * 3 + 2]) B[cc++] = 1 , B[cc++] = 1;
                else B[cc++] = 1;
            }
            else {
                if(A[i * 3 + 2]) B[cc++] = 0 , B[cc++] = 1;
                else B[cc++] = 0 , B[cc++] = 0;
            }
        }
        else {
            if(A[i * 3 + 1]) {
                if(A[i * 3 + 2]) B[cc++] = 1 , B[cc++] = 0;
                else B[cc++] = 0;
            }
            else if(A[i * 3 + 2]) B[cc++] = 1;
        }
    }
    for(int i = 0; i < 60; i++) X |= ((long long)B[i]<<i);
    return X;
}
# Verdict Execution time Memory Grader output
1 Incorrect 45 ms 4640 KB Output isn't correct - L* = 0
2 Incorrect 41 ms 4640 KB Output isn't correct - L* = 0
3 Incorrect 41 ms 4640 KB Output isn't correct - L* = 0
4 Incorrect 48 ms 4640 KB Output isn't correct - L* = 0
5 Incorrect 48 ms 4640 KB Output isn't correct - L* = 0
6 Incorrect 41 ms 4640 KB Output isn't correct - L* = 0
7 Incorrect 49 ms 4640 KB Output isn't correct - L* = 0
8 Incorrect 52 ms 4640 KB Output isn't correct - L* = 0
9 Incorrect 41 ms 4640 KB Output isn't correct - L* = 0
10 Incorrect 38 ms 4640 KB Output isn't correct - L* = 0
11 Incorrect 52 ms 4640 KB Output isn't correct - L* = 0
12 Incorrect 41 ms 4640 KB Output isn't correct - L* = 0
13 Incorrect 49 ms 4640 KB Output isn't correct - L* = 0
14 Incorrect 56 ms 4640 KB Output isn't correct - L* = 0
15 Incorrect 49 ms 4640 KB Output isn't correct - L* = 0
16 Incorrect 35 ms 4640 KB Output isn't correct - L* = 0
17 Incorrect 39 ms 4640 KB Output isn't correct - L* = 0
18 Incorrect 38 ms 4640 KB Output isn't correct - L* = 0
19 Incorrect 39 ms 4640 KB Output isn't correct - L* = 0
20 Incorrect 65 ms 4640 KB Output isn't correct - L* = 0
21 Incorrect 39 ms 4640 KB Output isn't correct - L* = 0
22 Incorrect 35 ms 4640 KB Output isn't correct - L* = 0
23 Incorrect 45 ms 4640 KB Output isn't correct - L* = 0
24 Incorrect 32 ms 4640 KB Output isn't correct - L* = 0
25 Incorrect 52 ms 4640 KB Output isn't correct - L* = 0
26 Incorrect 35 ms 4640 KB Output isn't correct - L* = 0
27 Incorrect 59 ms 4640 KB Output isn't correct - L* = 0
28 Incorrect 48 ms 4640 KB Output isn't correct - L* = 0
29 Incorrect 35 ms 4640 KB Output isn't correct - L* = 0
30 Incorrect 32 ms 4640 KB Output isn't correct - L* = 0
31 Incorrect 39 ms 4640 KB Output isn't correct - L* = 0
32 Incorrect 32 ms 4640 KB Output isn't correct - L* = 0
33 Incorrect 45 ms 4640 KB Output isn't correct - L* = 0
34 Incorrect 39 ms 4640 KB Output isn't correct - L* = 0
35 Incorrect 38 ms 4640 KB Output isn't correct - L* = 0
36 Incorrect 32 ms 4640 KB Output isn't correct - L* = 0
37 Incorrect 49 ms 4640 KB Output isn't correct - L* = 0
38 Incorrect 36 ms 4640 KB Output isn't correct - L* = 0
39 Incorrect 39 ms 4640 KB Output isn't correct - L* = 0
40 Incorrect 28 ms 4640 KB Output isn't correct - L* = 0