Submission #260317

# Submission time Handle Problem Language Result Execution time Memory
260317 2020-08-10T05:07:38 Z 문홍윤(#5075) Broken Device (JOI17_broken_device) C++14
0 / 100
2 ms 1160 KB
#include "Annalib.h"
#include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;

static bool ch[210];
static LL thr[210];
static int len=38;

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

void Anna(int N, LL X, int K, int P[]){
    memset(ch, 0, sizeof ch);
    for(int i=0; i<K; i++)ch[P[i]]=true;
    for(int i=1; i<=len; i++){
        thr[i]=X%3;
        X/=3;
    }
    int re=len;
    for(int i=0; i<75; i++){
        int l=INIT[i].F, r=INIT[i].S;
        if(re<0)Set(l, 0), Set(r, 0);
        if(thr[re]==0&&ch[r]){
            Set(l, 0), Set(r, 0);
            continue;
        }
        if(thr[re]==1&&ch[l]){
            Set(l, 0), Set(r, 0);
            continue;
        }
        if(thr[re]==2&&(ch[l]||ch[r])){
            Set(l, 0), Set(r, 0);
            continue;
        }
        if(thr[re]==0)Set(l, 0), Set(r, 1);
        if(thr[re]==1)Set(l, 1), Set(r, 0);
        if(thr[re]==2)Set(l, 1), Set(r, 1);
        re--;
    }
}
#include "Brunolib.h"
#include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;

static int len=38;

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

LL Bruno(int N, int A[]){
    LL ret=0;
    int num=0;
    for(int i=0; i<75; i++){
        int l=INIT[i].F, r=INIT[i].S;
        if(!A[l]&&!A[r])continue;
        ret*=3;
        if(A[l]&&!A[r])ret++;
        if(A[l]&&A[r])ret+=2;
        num++;
        if(num>=len)return ret;
    }
}

Compilation message

Bruno.cpp: In function 'LL Bruno(int, int*)':
Bruno.cpp:25:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 1020 KB Wrong Answer [2]
2 Incorrect 1 ms 900 KB Wrong Answer [2]
3 Incorrect 1 ms 780 KB Wrong Answer [2]
4 Incorrect 2 ms 772 KB Wrong Answer [2]
5 Incorrect 0 ms 644 KB Wrong Answer [2]
6 Incorrect 0 ms 1032 KB Wrong Answer [2]
7 Incorrect 0 ms 644 KB Wrong Answer [2]
8 Incorrect 0 ms 1160 KB Wrong Answer [2]
9 Incorrect 1 ms 804 KB Wrong Answer [2]
10 Incorrect 0 ms 900 KB Wrong Answer [2]
11 Incorrect 0 ms 772 KB Wrong Answer [2]
12 Incorrect 0 ms 644 KB Wrong Answer [2]
13 Incorrect 0 ms 1024 KB Wrong Answer [2]
14 Incorrect 0 ms 656 KB Wrong Answer [2]
15 Incorrect 0 ms 1032 KB Wrong Answer [2]
16 Incorrect 0 ms 900 KB Wrong Answer [2]
17 Incorrect 0 ms 772 KB Wrong Answer [2]
18 Incorrect 1 ms 900 KB Wrong Answer [2]
19 Incorrect 0 ms 1024 KB Wrong Answer [2]
20 Incorrect 0 ms 900 KB Wrong Answer [2]
21 Incorrect 1 ms 1032 KB Wrong Answer [2]
22 Incorrect 0 ms 900 KB Wrong Answer [2]
23 Incorrect 0 ms 772 KB Wrong Answer [2]
24 Incorrect 0 ms 1028 KB Wrong Answer [2]
25 Incorrect 0 ms 1032 KB Wrong Answer [2]
26 Incorrect 0 ms 1032 KB Wrong Answer [2]
27 Incorrect 2 ms 772 KB Wrong Answer [2]
28 Incorrect 0 ms 1032 KB Wrong Answer [2]
29 Incorrect 0 ms 1032 KB Wrong Answer [2]
30 Incorrect 0 ms 1028 KB Wrong Answer [2]
31 Incorrect 0 ms 900 KB Wrong Answer [2]
32 Incorrect 1 ms 900 KB Wrong Answer [2]
33 Incorrect 1 ms 644 KB Wrong Answer [2]
34 Incorrect 0 ms 1032 KB Wrong Answer [2]
35 Incorrect 0 ms 1032 KB Wrong Answer [2]
36 Incorrect 0 ms 900 KB Wrong Answer [2]
37 Incorrect 0 ms 772 KB Wrong Answer [2]
38 Incorrect 0 ms 900 KB Wrong Answer [2]
39 Incorrect 0 ms 772 KB Wrong Answer [2]
40 Incorrect 0 ms 772 KB Wrong Answer [2]