horses.cpp: In function 'void build(int, int, int)':
horses.cpp:25:9: error: 'q' was not declared in this scope
if(!q)
^
horses.cpp:31:51: error: invalid array assignment
tree[node]=max(tree[node*2],tree[node*2+1]);
^
horses.cpp: In function 'void update(int, int, int, int, int, int)':
horses.cpp:51:51: error: invalid array assignment
tree[node]=max(tree[node*2],tree[node*2+1]);
^
horses.cpp: In function 'long long int query(int, int, int, int, int, int)':
horses.cpp:54:65: warning: declaration of 'y' shadows a global declaration [-Wshadow]
long long query(int l , int r , int node , int x , int y , int q)
^
horses.cpp:10:11: note: shadowed declaration is here
long long y[N];
^
horses.cpp:54:65: warning: declaration of 'x' shadows a global declaration [-Wshadow]
long long query(int l , int r , int node , int x , int y , int q)
^
horses.cpp:9:11: note: shadowed declaration is here
long long x[N];
^
horses.cpp: In function 'int solve()':
horses.cpp:83:53: error: expected ';' before ')' token
for(upper_bound(st.begin(),st.end(),i)!=st.end())
^
horses.cpp:97:5: error: expected primary-expression before 'return'
return (query(0,n-1,1,bestpos,n-1,1)*query(0,n-1,1,0,bestpos,0))%m;
^~~~~~
horses.cpp:97:5: error: expected ';' before 'return'
horses.cpp:97:5: error: expected primary-expression before 'return'
horses.cpp:97:5: error: expected ')' before 'return'
horses.cpp:97:69: warning: conversion to 'int' from 'long long int' may alter its value [-Wconversion]
return (query(0,n-1,1,bestpos,n-1,1)*query(0,n-1,1,0,bestpos,0))%m;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
horses.cpp:66:15: warning: unused variable 'ret' [-Wunused-variable]
long long ret=0;
^~~
horses.cpp:67:12: warning: unused variable 'temp' [-Wunused-variable]
long long temp=1;
^~~~
horses.cpp:69:10: warning: unused variable 'q' [-Wunused-variable]
bool q=0;
^
horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:100:33: warning: declaration of 'N' shadows a global declaration [-Wshadow]
int init(int N, int X[], int Y[])
^
horses.cpp:7:11: note: shadowed declaration is here
const int N=5e5+55;
^