horses.cpp: In function 'long long int pow(long long int, long long int, long long int)':
horses.cpp:31:21: warning: declaration of 'mod' shadows a global declaration [-Wshadow]
31 | ll pow(ll x,ll y,ll mod){return(!y?1:pow(x*x%mod,y/2,mod)*(y&1?x:1))%mod;}
| ^
horses.cpp:24:20: note: shadowed declaration is here
24 | const int N=5e5+99,mod=1e9+7;
| ^~~
horses.cpp: In function 'int solve()':
horses.cpp:56:37: error: no matching function for call to 'max(long long int&, int)'
56 | maxm(ans,1ll*a[i]*max(ans,get(i,n)));
| ^
horses.cpp:13:27: note: in definition of macro 'maxm'
13 | #define maxm(a,b) a=max(a,b)
| ^
In file included from /usr/include/c++/10/bits/char_traits.h:39,
from /usr/include/c++/10/ios:40,
from /usr/include/c++/10/istream:38,
from /usr/include/c++/10/sstream:38,
from /usr/include/c++/10/complex:45,
from /usr/include/c++/10/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
from horses.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:254:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
254 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/10/bits/stl_algobase.h:254:5: note: template argument deduction/substitution failed:
horses.cpp:56:37: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
56 | maxm(ans,1ll*a[i]*max(ans,get(i,n)));
| ^
horses.cpp:13:27: note: in definition of macro 'maxm'
13 | #define maxm(a,b) a=max(a,b)
| ^
In file included from /usr/include/c++/10/bits/char_traits.h:39,
from /usr/include/c++/10/ios:40,
from /usr/include/c++/10/istream:38,
from /usr/include/c++/10/sstream:38,
from /usr/include/c++/10/complex:45,
from /usr/include/c++/10/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
from horses.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:300:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
300 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/10/bits/stl_algobase.h:300:5: note: template argument deduction/substitution failed:
horses.cpp:56:37: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
56 | maxm(ans,1ll*a[i]*max(ans,get(i,n)));
| ^
horses.cpp:13:27: note: in definition of macro 'maxm'
13 | #define maxm(a,b) a=max(a,b)
| ^
In file included from /usr/include/c++/10/algorithm:62,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
from horses.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3480:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(std::initializer_list<_Tp>)'
3480 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/10/bits/stl_algo.h:3480:5: note: template argument deduction/substitution failed:
horses.cpp:56:37: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
56 | maxm(ans,1ll*a[i]*max(ans,get(i,n)));
| ^
horses.cpp:13:27: note: in definition of macro 'maxm'
13 | #define maxm(a,b) a=max(a,b)
| ^
In file included from /usr/include/c++/10/algorithm:62,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
from horses.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3486:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(std::initializer_list<_Tp>, _Compare)'
3486 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/10/bits/stl_algo.h:3486:5: note: template argument deduction/substitution failed:
horses.cpp:56:37: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
56 | maxm(ans,1ll*a[i]*max(ans,get(i,n)));
| ^
horses.cpp:13:27: note: in definition of macro 'maxm'
13 | #define maxm(a,b) a=max(a,b)
| ^
horses.cpp:61:20: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
61 | return 1ll*res*ans%mod;
| ~~~~~~~~~~~^~~~
horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:68:17: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
68 | pd=1ll*pd*a[i]%mod;
| ~~~~~~~~~~~^~~~
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:77:33: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
77 | pd=1ll*pd*pow(a[pos],mod-2,mod)%mod;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
horses.cpp:79:18: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
79 | pd=1ll*pd*a[pos]%mod;
| ~~~~~~~~~~~~~^~~~