Submission #204767

# Submission time Handle Problem Language Result Execution time Memory
204767 2020-02-27T04:59:42 Z balbit Broken Device (JOI17_broken_device) C++14
0 / 100
60 ms 3568 KB
#include <bits/stdc++.h>
using namespace std;
#include "Annalib.h"



void Anna( int N, long long X, int K, int P[] ){
    vector<int> p = {110,51,11,69,119,142,17,109,26,101,115,39,108,2,75,56,59,18,32,116,143,86,57,133,14,42,27,136,104,58,30,96,13,68,130,114,71,102,9,139,66,80,103,79,89,81,106,0,134,41,88,28,52,43,16,60,49,105,149,132,29,112,141,45,53,76,8,33,37,15,25,55,70,31,82,47,111,107,90,117,23,122,77,19,126,44,120,131,97,1,38,95,4,21,137,5,121,65,135,144,7,138,64,148,140,100,73,10,83,113,92,48,61,127,87,67,40,124,63,129,93,78,74,54,34,123,85,36,6,24,3,125,72,145,94,50,62,146,98,22,118,128,35,91,46,12,99,84,20,147};
    vector<int> pr(N);
    for (int i = 0; i<N; i++) {
        pr[p[i]] = i;
    }
    vector<int> ans (150);
    for (int i = 0; i<N; i+=2) {
        int a = p[i], b = p[i+1];
        if (!P[a] && !P[b]) {
            int x3 = X/3; X/=3;
            if (x3 == 1 || x3 == 2) ans[a] = 1;
            if (x3 == 0 || x3 == 2) ans[b] = 1;
        }
    }
    for (int i = 0; i<N; i++){
        Set(i,ans[i]);
    }
}
#include <bits/stdc++.h>
#define ll long long
using namespace std;
#include "Brunolib.h"

long long Bruno( int N, int A[] ){
    vector<int> p = {110,51,11,69,119,142,17,109,26,101,115,39,108,2,75,56,59,18,32,116,143,86,57,133,14,42,27,136,104,58,30,96,13,68,130,114,71,102,9,139,66,80,103,79,89,81,106,0,134,41,88,28,52,43,16,60,49,105,149,132,29,112,141,45,53,76,8,33,37,15,25,55,70,31,82,47,111,107,90,117,23,122,77,19,126,44,120,131,97,1,38,95,4,21,137,5,121,65,135,144,7,138,64,148,140,100,73,10,83,113,92,48,61,127,87,67,40,124,63,129,93,78,74,54,34,123,85,36,6,24,3,125,72,145,94,50,62,146,98,22,118,128,35,91,46,12,99,84,20,147};
    vector<int> pr(N);
    for (int i = 0; i<N; i++) {
        pr[p[i]] = i;
    }
    ll X = 0;
    ll p3 = 1;
    for (int i = 0; i<N; i+=2) {
        int a = p[i], b = p[i+1];
        if (A[a] || A[b]) {
            int x3 = 2*A[a] + A[b] -1;
            X+=p3 * x3;
            p3 *= 3;
        }
    }
    return X;
}
# Verdict Execution time Memory Grader output
1 Partially correct 50 ms 3568 KB Output isn't correct - L* = 0
2 Partially correct 49 ms 3312 KB Output isn't correct - L* = 0
3 Partially correct 49 ms 3264 KB Output isn't correct - L* = 0
4 Partially correct 48 ms 3056 KB Output isn't correct - L* = 0
5 Partially correct 60 ms 3312 KB Output isn't correct - L* = 0
6 Partially correct 48 ms 3312 KB Output isn't correct - L* = 0
7 Partially correct 50 ms 3312 KB Output isn't correct - L* = 0
8 Partially correct 50 ms 3320 KB Output isn't correct - L* = 0
9 Partially correct 49 ms 3568 KB Output isn't correct - L* = 0
10 Partially correct 50 ms 3312 KB Output isn't correct - L* = 0
11 Partially correct 50 ms 3312 KB Output isn't correct - L* = 0
12 Partially correct 48 ms 3304 KB Output isn't correct - L* = 0
13 Partially correct 50 ms 3312 KB Output isn't correct - L* = 0
14 Partially correct 47 ms 3312 KB Output isn't correct - L* = 0
15 Partially correct 48 ms 3312 KB Output isn't correct - L* = 0
16 Partially correct 48 ms 3160 KB Output isn't correct - L* = 0
17 Partially correct 50 ms 3384 KB Output isn't correct - L* = 0
18 Partially correct 48 ms 3312 KB Output isn't correct - L* = 0
19 Partially correct 48 ms 3312 KB Output isn't correct - L* = 0
20 Partially correct 47 ms 3312 KB Output isn't correct - L* = 0
21 Partially correct 47 ms 3312 KB Output isn't correct - L* = 0
22 Partially correct 48 ms 3312 KB Output isn't correct - L* = 0
23 Partially correct 49 ms 3312 KB Output isn't correct - L* = 0
24 Partially correct 49 ms 3568 KB Output isn't correct - L* = 0
25 Partially correct 48 ms 3312 KB Output isn't correct - L* = 0
26 Partially correct 49 ms 3320 KB Output isn't correct - L* = 0
27 Partially correct 49 ms 3312 KB Output isn't correct - L* = 0
28 Partially correct 50 ms 3312 KB Output isn't correct - L* = 0
29 Partially correct 48 ms 3312 KB Output isn't correct - L* = 0
30 Partially correct 48 ms 3320 KB Output isn't correct - L* = 0
31 Partially correct 48 ms 3312 KB Output isn't correct - L* = 0
32 Partially correct 48 ms 3312 KB Output isn't correct - L* = 0
33 Partially correct 48 ms 3568 KB Output isn't correct - L* = 0
34 Partially correct 52 ms 3312 KB Output isn't correct - L* = 0
35 Partially correct 49 ms 3312 KB Output isn't correct - L* = 0
36 Partially correct 47 ms 3312 KB Output isn't correct - L* = 0
37 Partially correct 48 ms 3312 KB Output isn't correct - L* = 0
38 Partially correct 47 ms 3320 KB Output isn't correct - L* = 0
39 Partially correct 49 ms 3312 KB Output isn't correct - L* = 0
40 Partially correct 49 ms 3312 KB Output isn't correct - L* = 0