Submission #487205

#TimeUsernameProblemLanguageResultExecution timeMemory
487205AnasBenMoussaSecret (JOI14_secret)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "secret.h" using namespace std; long long a[10000]; int tree[400000];int n; int mer(int a,int b){ if(x==INT_MIN){return b;} if(y==INT_MIN){return a;} return Secret(a,b); } void build(int v, int tl, int tr) { if (tl == tr) { tree[v] = a[tl]; } else { int tm = (tl + tr) / 2; build( v*2, tl, tm); build( v*2+1, tm+1, tr); tree[v] = mer(tree[v*2],tree[v*2+1]); } } void Init(int N, int A[]){ n=N; for(long long i=0;i<N;i++){ a[i]=A[i]; } build(0,0,N-1); } int sum(int v, int tl, int tr, int l, int r) { if (l > r) return INT_MIN ; if (l == tl && r == tr) { return tree[v]; } int tm = (tl + tr) / 2; return mer(sum(v*2, tl, tm, l, min(r, tm)) ,sum(v*2+1, tm+1, tr, max(l, tm+1), r)); } int Query(int L , int R){ return sum(0,0,n-1,L,R); }

Compilation message (stderr)

secret.cpp: In function 'int mer(int, int)':
secret.cpp:9:8: error: 'x' was not declared in this scope
    9 |     if(x==INT_MIN){return b;}
      |        ^
secret.cpp:10:8: error: 'y' was not declared in this scope
   10 |     if(y==INT_MIN){return a;}
      |        ^