Submission #1171393

#TimeUsernameProblemLanguageResultExecution timeMemory
1171393ezzzaySecret (JOI14_secret)C++20
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define pb push_back
vector<int>a;
int st[2005];
int Secret(int X, int Y) {
  return X^Y;
}
void build(int node, int L, int R){
    if(L==R){
        st[node]=a[L];
        return ;
    }
    int mid= ( L + R);
    build(node*2,L,mid);
    build(node*2+1,mid+1,R);
    st[node]= Secret(st[node*2],st[node*2+1]);
}
int find(int node, int L, int R, int l, int r){
    if(L>r or l>R)return -1;
    if(l<=L and R<=r)return st[node];
    int mid= ( L+R);
    int x= find(node*2,L,mid,l,r);
    int y=find(node*2+1, mid+1,R,l,r);
    if(x==-1 and y==-1)return -1;
    if(x==-1)return y;
    if(y==-1)return x;
    return Secret(st[node*2],st[node*2+1]);
}
void Init(int N, int A[]) {
    a.clear();
    a.pb(0);
    for(int i=0;i<N;i++)a.pb(A[i]);
    build(1,1,N);
}

int Query(int L, int R) {
    L++;
    R++;
    int n=a.size() - 1;
    return find(1,1,n,L,R);
}

Compilation message (stderr)

/usr/bin/ld: /tmp/ccwoaxJX.o: in function `Secret(int, int)':
grader.cpp:(.text+0x2d0): multiple definition of `Secret(int, int)'; /tmp/ccPbTmP0.o:secret.cpp:(.text+0x0): first defined here
collect2: error: ld returned 1 exit status