Submission #730973

# Submission time Handle Problem Language Result Execution time Memory
730973 2023-04-26T17:20:34 Z alexdd Secret (JOI14_secret) C++17
Compilation error
0 ms 0 KB
#include "secret.h"
#include<bits/stdc++.h>
using namespace std;
#define int long long
int bit[2][2];
int a[1005];
int n;
int op(int x, int y)
{
    int rez=0,a,b;
    for(int i=0;i<30;i++)
    {
        a = ((x&(1<<i))!=0);
        b = ((y&(1<<i))!=0);
        rez += (1<<i) * bit[a][b];
    }
    return rez;
}
void Init(int N, int A[])
{
    for(int i=0;i<2;i++)
        for(int j=0;j<2;j++)
            bit[i][j] = Secret(i,j);
    n=N;
    for(int i=1;i<=n;i++)
        a[i]=A[i];
}

int Query(int L, int R)
{
    int rez = a[L];
    for(int i=L+1;i<=R;i++)
    {
        rez = op(rez, a[L]);
    }
    return rez;
}


Compilation message

/usr/bin/ld: /tmp/ccgkAf7t.o: in function `main':
grader-full.cpp:(.text.startup+0x2a8): undefined reference to `Init(int, int*)'
/usr/bin/ld: grader-full.cpp:(.text.startup+0x30b): undefined reference to `Query(int, int)'
collect2: error: ld returned 1 exit status