Language: C++

#include<iostream>
#include<vector>
#include<cmath>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define INF pow(2,31)-1
#define B 300
using namespace std;

long long n,q,com,x,y;
vector<int> dt;
vector<int> backet;

void find(long long a,long long b){
	long long res=INF;
	for(long long i=a;i<b+1;){
		if(i%B==0 && i+B-1<=b){
			res=min(res,backet[i/B]);
			i+=B;
		}else{
			res=min(res,dt[i]);
			i++;
		}
	}
	cout<<res<<endl;
}

void update(long long i,long long x){
	dt[i]=x;
	long long res=INF;
	for(long long j=i-i%B;j<min(n,i+B);j++){
		res=min(res,dt[j]);
	}
	backet[i/B]=res;
}

int main(){
	cin>>n>>q;
	rep(i,n)dt.push_back(INF);
	rep(i,n/B+1)backet.push_back(INF);
	rep(i,q){
		cin>>com>>x>>y;
		if(com==0)update(x,y);
		else find(x,y);
	}
	return 0;
}

Compiler output:
a.cc: In function 'void find(long long int, long long int)':
a.cc:18:32: error: no matching function for call to 'min(long long int&, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)'
   18 |                         res=min(res,backet[i/B]);
      |                             ~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:18:32: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'})
   18 |                         res=min(res,backet[i/B]);
      |                             ~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
a.cc:21:32: error: no matching function for call to 'min(long long int&, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)'
   21 |                         res=min(res,dt[i]);
      |                             ~~~^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:21:32: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'})
   21 |                         res=min(res,dt[i]);
      |                             ~~~^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
a.cc: In function 'void update(long long int, long long int)':
a.cc:32:24: error: no matching function for call to 'min(long long int&, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)'
   32 |                 res=min(res,dt[j]);
      |                     ~~~^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:32:24: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'})
   32 |                 res=min(res,dt[j]);
      |                     ~~~^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided