Submission #70681

# Submission time Handle Problem Language Result Execution time Memory
70681 2018-08-23T08:28:44 Z Inovak Broken Device (JOI17_broken_device) C++14
0 / 100
4 ms 1076 KB
#include "Annalib.h"

#include <bits/stdc++.h>

#define fr first
#define sc second
#define pb push_back
#define mk make_pair
#define ll long long
#define OK puts("OK");
#define sz(s) (int)s.size()
#define all(s) s.begin(), s.end()

using namespace std;

int u[1000];

void Anna( int N, long long X, int K, int P[] ) {
    ll cnt = 0, cn = 0;
    ll l = 0;
    while((1ll << l) <= X) l++;
  l--;

    for(int i = 0; i < K; i++)
        u[P[i]] = 1;

    for( int i = 0; i < N - 1; i++) {
        if(u[i] || u[i + 1] || cnt >= l) {
            Set(i, 0);
            cn++;
        }
        else {
            Set(i, 1);
            Set(i + 1, ((X & (1ll << cnt)) ? 1 : 0));
            cn += 2;
            cnt++;
            i++;
        }
    }
    assert(cnt >= l);
    if(cn < N)
        Set(N - 1, 0);
}
#include "Brunolib.h"


long long Bruno( int N, int A[] ) {
    long long cnt = 0;
    long long X = 0;

    for(int i = 0; i < N - 1; i++) {
        if(A[i] == 1 && A[i + 1] == 1) {
            X += (1ll << cnt);
            cnt++;
            i++;
        }
        else if(A[i] == 1) {
            cnt++;
            i++;
        }
    }
  
    return X;
}
# Verdict Execution time Memory Grader output
1 Runtime error 4 ms 508 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Runtime error 4 ms 556 KB Execution killed with signal 11 (could be triggered by violating memory limits)
3 Runtime error 4 ms 788 KB Execution killed with signal 11 (could be triggered by violating memory limits)
4 Runtime error 4 ms 788 KB Execution killed with signal 11 (could be triggered by violating memory limits)
5 Runtime error 3 ms 788 KB Execution killed with signal 11 (could be triggered by violating memory limits)
6 Runtime error 3 ms 788 KB Execution killed with signal 11 (could be triggered by violating memory limits)
7 Runtime error 2 ms 788 KB Execution killed with signal 11 (could be triggered by violating memory limits)
8 Runtime error 3 ms 876 KB Execution killed with signal 11 (could be triggered by violating memory limits)
9 Runtime error 3 ms 936 KB Execution killed with signal 11 (could be triggered by violating memory limits)
10 Runtime error 3 ms 952 KB Execution killed with signal 11 (could be triggered by violating memory limits)
11 Runtime error 3 ms 1060 KB Execution killed with signal 11 (could be triggered by violating memory limits)
12 Runtime error 4 ms 1060 KB Execution killed with signal 11 (could be triggered by violating memory limits)
13 Runtime error 3 ms 1060 KB Execution killed with signal 11 (could be triggered by violating memory limits)
14 Runtime error 2 ms 1060 KB Execution killed with signal 11 (could be triggered by violating memory limits)
15 Runtime error 4 ms 1060 KB Execution killed with signal 11 (could be triggered by violating memory limits)
16 Runtime error 3 ms 1060 KB Execution killed with signal 11 (could be triggered by violating memory limits)
17 Runtime error 3 ms 1060 KB Execution killed with signal 11 (could be triggered by violating memory limits)
18 Runtime error 3 ms 1060 KB Execution killed with signal 11 (could be triggered by violating memory limits)
19 Runtime error 3 ms 1072 KB Execution killed with signal 11 (could be triggered by violating memory limits)
20 Runtime error 3 ms 1072 KB Execution killed with signal 11 (could be triggered by violating memory limits)
21 Runtime error 3 ms 1072 KB Execution killed with signal 11 (could be triggered by violating memory limits)
22 Runtime error 3 ms 1072 KB Execution killed with signal 11 (could be triggered by violating memory limits)
23 Runtime error 3 ms 1072 KB Execution killed with signal 11 (could be triggered by violating memory limits)
24 Runtime error 3 ms 1072 KB Execution killed with signal 11 (could be triggered by violating memory limits)
25 Runtime error 3 ms 1072 KB Execution killed with signal 11 (could be triggered by violating memory limits)
26 Runtime error 3 ms 1072 KB Execution killed with signal 11 (could be triggered by violating memory limits)
27 Runtime error 3 ms 1072 KB Execution killed with signal 11 (could be triggered by violating memory limits)
28 Runtime error 3 ms 1072 KB Execution killed with signal 11 (could be triggered by violating memory limits)
29 Runtime error 2 ms 1072 KB Execution killed with signal 11 (could be triggered by violating memory limits)
30 Runtime error 3 ms 1072 KB Execution killed with signal 11 (could be triggered by violating memory limits)
31 Runtime error 3 ms 1076 KB Execution killed with signal 11 (could be triggered by violating memory limits)
32 Runtime error 4 ms 1076 KB Execution killed with signal 11 (could be triggered by violating memory limits)
33 Runtime error 3 ms 1076 KB Execution killed with signal 11 (could be triggered by violating memory limits)
34 Runtime error 3 ms 1076 KB Execution killed with signal 11 (could be triggered by violating memory limits)
35 Runtime error 3 ms 1076 KB Execution killed with signal 11 (could be triggered by violating memory limits)
36 Runtime error 3 ms 1076 KB Execution killed with signal 11 (could be triggered by violating memory limits)
37 Runtime error 3 ms 1076 KB Execution killed with signal 11 (could be triggered by violating memory limits)
38 Runtime error 2 ms 1076 KB Execution killed with signal 11 (could be triggered by violating memory limits)
39 Runtime error 3 ms 1076 KB Execution killed with signal 11 (could be triggered by violating memory limits)
40 Runtime error 2 ms 1076 KB Execution killed with signal 11 (could be triggered by violating memory limits)