Submission #109468

# Submission time Handle Problem Language Result Execution time Memory
109468 2019-05-06T16:27:20 Z popovicirobert Broken Device (JOI17_broken_device) C++14
41 / 100
66 ms 3584 KB
#include "Annalib.h"
#include <bits/stdc++.h>

using namespace std;

void Anna( int N, long long X, int K, int P[] ){

    vector <int> arr(N);

    int i;
    for(i = 0; i < K; i++) {
        arr[P[i]] = 1;
    }

    vector <int> sol(N);
    i = 0;

    while(i < N - 1) {

        if(arr[i] + arr[i + 1]) {
            sol[i] = sol[i + 1] = 0;
        }
        else {
            if(X & 1) {
                sol[i] = 1;
                sol[i + 1] = 0;
            }
            else {
                sol[i] = sol[i + 1] = 1;
            }
            X >>= 1;
        }

        i += 2;

    }

    for(i = 0; i < N; i++) {
        Set(i, sol[i]);
    }

}
#include "Brunolib.h"
#include <bits/stdc++.h>
#define ll long long

long long Bruno( int N, int A[] ){

    ll ans = 0, pw = 1;
    int i = 0;

    while(i < N - 1) {
        int cur = A[i] + A[i + 1];
        if(cur == 1) {
            ans += pw;
            pw *= 2;
        }
        else if(cur == 2) {
            pw *= 2;
        }
        i += 2;
    }

    return ans;

}
# Verdict Execution time Memory Grader output
1 Partially correct 44 ms 3312 KB Output is partially correct - L* = 15
2 Partially correct 40 ms 3328 KB Output is partially correct - L* = 15
3 Partially correct 45 ms 3064 KB Output is partially correct - L* = 16
4 Partially correct 43 ms 3328 KB Output is partially correct - L* = 15
5 Partially correct 40 ms 3584 KB Output is partially correct - L* = 15
6 Partially correct 45 ms 3312 KB Output is partially correct - L* = 15
7 Partially correct 49 ms 3312 KB Output is partially correct - L* = 15
8 Partially correct 41 ms 3328 KB Output is partially correct - L* = 15
9 Partially correct 40 ms 3568 KB Output is partially correct - L* = 16
10 Partially correct 36 ms 3328 KB Output is partially correct - L* = 16
11 Partially correct 35 ms 3312 KB Output is partially correct - L* = 15
12 Partially correct 41 ms 3320 KB Output is partially correct - L* = 16
13 Partially correct 43 ms 3312 KB Output is partially correct - L* = 15
14 Partially correct 57 ms 3192 KB Output is partially correct - L* = 15
15 Partially correct 40 ms 3312 KB Output is partially correct - L* = 15
16 Partially correct 52 ms 3328 KB Output is partially correct - L* = 15
17 Partially correct 47 ms 3072 KB Output is partially correct - L* = 15
18 Partially correct 45 ms 3312 KB Output is partially correct - L* = 15
19 Partially correct 64 ms 3312 KB Output is partially correct - L* = 16
20 Partially correct 55 ms 3304 KB Output is partially correct - L* = 15
21 Partially correct 47 ms 3312 KB Output is partially correct - L* = 15
22 Partially correct 42 ms 3120 KB Output is partially correct - L* = 15
23 Partially correct 44 ms 3312 KB Output is partially correct - L* = 15
24 Partially correct 52 ms 3328 KB Output is partially correct - L* = 15
25 Partially correct 36 ms 3328 KB Output is partially correct - L* = 15
26 Partially correct 36 ms 3344 KB Output is partially correct - L* = 15
27 Partially correct 61 ms 3392 KB Output is partially correct - L* = 15
28 Partially correct 43 ms 3312 KB Output is partially correct - L* = 15
29 Partially correct 41 ms 3128 KB Output is partially correct - L* = 15
30 Partially correct 43 ms 3312 KB Output is partially correct - L* = 15
31 Partially correct 40 ms 3328 KB Output is partially correct - L* = 15
32 Partially correct 44 ms 3256 KB Output is partially correct - L* = 16
33 Partially correct 66 ms 3352 KB Output is partially correct - L* = 15
34 Partially correct 42 ms 3328 KB Output is partially correct - L* = 15
35 Partially correct 41 ms 3056 KB Output is partially correct - L* = 15
36 Partially correct 44 ms 3280 KB Output is partially correct - L* = 15
37 Partially correct 59 ms 3328 KB Output is partially correct - L* = 16
38 Partially correct 49 ms 3312 KB Output is partially correct - L* = 15
39 Partially correct 43 ms 3328 KB Output is partially correct - L* = 15
40 Partially correct 37 ms 3328 KB Output is partially correct - L* = 15