Submission #531738

# Submission time Handle Problem Language Result Execution time Memory
531738 2022-03-01T11:10:12 Z pokmui9909 Broken Device (JOI17_broken_device) C++17
Compilation error
0 ms 0 KB
#include "Annalib.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

ll C[155];
void MySet(ll n, ll a, ll b, ll c){
    Set(n, a);
    Set(n + 1, b);
    Set(n + 2, c);
}

void Anna(int N, long long X, int K, int P[]){
    fill(C, C + 155, 0);
    for(ll i = 0; i < K; i++){
        C[P[i]] = 1;
    }
    vector<ll> V;
    while(V.size() <= 154){
        V.push_back(X % 2);
        X /= 2;
    }

    for(ll i = 0, j = 0; i < 150; i += 3){
        if(C[i] + C[i + 1] + C[i + 2] == 0){
            if(V[j] == 0 && V[j + 1] == 0) MySet(i, 1, 0, 0);
            if(V[j] == 0 && V[j + 1] == 1) MySet(i, 1, 0, 1);
            if(V[j] == 1 && V[j + 1] == 0) MySet(i, 0, 1, 1);
            if(V[j] == 1 && V[j + 1] == 1) MySet(i, 1, 1, 1);
            j += 2;
        } else if(C[i] + C[i + 1] + C[i + 2] == 1) {
            if(V[j] == 0){
                if(C[j + 1] == 0){
                    MySet(i, 0, 1, 0);
                    j++;
                } else if(V[j + 1] == 0){
                    MySet(i, 1, 0, 0);
                    j += 2;
                } else {
                    MySet(i, 1, 0, 1);
                    j += 2;
                }
            } else if(C[i + 2] == 1) {
                MySet(i, 1, 1, 0);
                j++;
            } else {
                MySet(i, 0, 0, 1);
                j++;
            }
        } else {
            MySet(i, 0, 0, 0);
        }
    }
}



    

Compilation message

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