Language: C++

#include <bits/stdc++.h>
using namespace std;
int t[800000];
long long maxquery(long long index,long long lb,long long rb,long long lq,long long rq)
{
	if(lq==lb&&rq==rb)
		return t[index];
	long long mid=(lb+rb)>>1;
	if(lb>mid)
		return maxquery(index*2+1,mid+1,rb,lq,rq);
	else if(rb<=mid)
		return maxquery(index*2,lb,mid,lq,rq);
	else
		return max(maxquery(index*2+1,mid+1,rb,mid+1,rq),maxquery(index*2,lb,mid,lq,mid));
}
long long updaterange(long long index,long long lb,long long rb,long long leaf,long long value)
{
	if(lb==rb&&lb==leaf)
		return t[index]=value;
	long long mid=(lb+rb)>>1;
	if(leaf>mid)
		return t[index]=max(t[index],updaterange(index<<1|1,mid+1,rb,leaf,value));
	else
		return t[index]=max(t[index],updaterange(index<<1|1,lb,mid,leaf,value));
}
int main()
{
	long long i,t,s,ans=0;
	scanf("%lld",&n);
	for(i=1;i<=n;i++)
	{
		scanf("%lld",&a[i]);					
	}
	for(i=1;i<=n;i++)
	{
		scanf("%lld",&s);
		
	}
	
	printf("%lld",ans);
	return 0;
}

Compiler output:
a.cc: In function 'long long int updaterange(long long int, long long int, long long int, long long int, long long int)':
a.cc:22:36: error: no matching function for call to 'max(int&, long long int)'
   22 |                 return t[index]=max(t[index],updaterange(index<<1|1,mid+1,rb,leaf,value));
      |                                 ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:22:36: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   22 |                 return t[index]=max(t[index],updaterange(index<<1|1,mid+1,rb,leaf,value));
      |                                 ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:22:36: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   22 |                 return t[index]=max(t[index],updaterange(index<<1|1,mid+1,rb,leaf,value));
      |                                 ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:24:36: error: no matching function for call to 'max(int&, long long int)'
   24 |                 return t[index]=max(t[index],updaterange(index<<1|1,lb,mid,leaf,value));
      |                                 ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:24:36: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   24 |                 return t[index]=max(t[index],updaterange(index<<1|1,lb,mid,leaf,value));
      |                                 ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:24:36: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   24 |                 return t[index]=max(t[index],updaterange(index<<1|1,lb,mid,leaf,value));
      |                                 ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:29:23: error: 'n' was not declared in this scope
   29 |         scanf("%lld",&n);
      |                       ^
a.cc:32:31: error: 'a' was not declared in this scope
   32 |                 scanf("%lld",&a[i]);
      |                               ^