Submission #388084

# Submission time Handle Problem Language Result Execution time Memory
388084 2021-04-10T03:24:46 Z AngusRitossa Broken Device (JOI17_broken_device) C++14
Compilation error
0 ms 0 KB
#include "broken.h"
#include <bits/stdc++.h>
using namespace std;

const long long rng = 890834321347256190ll;

void Anna( int N, long long X, int K, int P[] ){
    X ^= rng;
    vector<int> broke(N);
    for (int i = 0; i < K; ++i) broke[P[i]] = 1;
    int i = 0;
    while (X) {
        if (!broke[i] && (!broke[i+1] || !(X&1))) {
            Set(i++, 1);
            Set(i++, X&1);
            X >>= 1;
        } else {
            Set(i++, 0);
        }
    }
    assert(i <= N);
    // cout << i << endl;
    for (; i < N; ++i) Set(i, 0);
}

long long Bruno( int N, int A[] ){
    long long ans = 0, b = 0;
    for (int i = 0; i < N; ++i) {
        if (A[i]) {
            ans |= (long long) A[i+1] << b;
            i++;
            b++;
        }
    }
    cout << (ans ^ rng) << endl;
    return ans ^ rng;
}



    

Compilation message

Anna.cpp:1:10: fatal error: broken.h: No such file or directory
    1 | #include "broken.h"
      |          ^~~~~~~~~~
compilation terminated.

/tmp/ccEYRe79.o: In function `main':
grader_bruno.cpp:(.text.startup+0x13d): undefined reference to `Bruno(int, int*)'
collect2: error: ld returned 1 exit status