Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <numeric>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <time.h>

using namespace std;
typedef long long ll;
#define pl pair<ll,ll>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) for(int i=0;i<(n);++i)
#define foreach(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); itr++)
#define dbg(x) cout << #x"="<< (x) << endl
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back(a) 
#define in(x) cin >> x;
#define all(x) (x).begin(), (x).end()
#define INF 2147483600
#define fi first
#define se second

ll n,q,ans;
ll size;
vector<int> v;
//??´??°??¨??????????°?????±???????.
//?????°???????????¨
//???(n-1)/2 ??????n ???2n+1 2n+2
//n+i-1?????¬???
//????????????????????¨????????¨
// sum_{n=1}^n 2^(n-1)=2^n -1
//??????????????°???2^n-1???????????????.

int parent(int x){
	return (x-1)/2;
}

int child1(int x){
	return 2*x+1;
}

int child2(int x){
	return 2*x+2;
}

void Update(int x, int y){
	//??¬?????´??°
	int self=n+x-1;
	v[self]=y;
	//????????´??°????????????
	while(self!=0){
		self=parent(self);
		v[self]=min(v[child1(self)],v[child2(self)]);
	}
}

void Search(int x, int y){
	x=n+x-1;
	y=n+y-1;
	int MAX;
	int MIN;
	//??????????????£????????£???
	//x?????????????????????????????£???child2
	//y?????????????????????????????£???child1
	//??£?¶???????????????£????????????
	while(MIN-MAX==1){
		if(x%2==1){
			x=parent(x);
		}
		if(y%2==0){
			y=parent(y);
		}
		MAX=x;
		MIN=y;
		while(child2(MAX)>size){
			MAX=child2(MAX);
		}
		while(child1(MIN)>size){
			MIN=child1(MIN);
		}
	}
	cout<<min(v[x],v[y])<<endl;
}

int main(){
	int a,x,y;
	cin>>n>>q;
	size=log2(n);
	size=pow(2,size+1)-1;
	rep(i,size){
		v.pb(INT_MAX);
	}

	rep(i,q){
		cin>>a>>x>>y;
		if(a==0){
			Update(x,y);
		}else{
			Search(x,y);
		}
	}


    return 0;
}

Compiler output:
a.cc: In function 'void Search(int, int)':
a.cc:79:35: error: reference to 'size' is ambiguous
   79 |                 while(child2(MAX)>size){
      |                                   ^~~~
In file included from /usr/include/c++/14/string:53,
                 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/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:28:4: note:                 'll size'
   28 | ll size;
      |    ^~~~
a.cc:82:35: error: reference to 'size' is ambiguous
   82 |                 while(child1(MIN)>size){
      |                                   ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:28:4: note:                 'll size'
   28 | ll size;
      |    ^~~~
a.cc: In function 'int main()':
a.cc:92:9: error: reference to 'size' is ambiguous
   92 |         size=log2(n);
      |         ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:28:4: note:                 'll size'
   28 | ll size;
      |    ^~~~
a.cc:93:9: error: reference to 'size' is ambiguous
   93 |         size=pow(2,size+1)-1;
      |         ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:28:4: note:                 'll size'
   28 | ll size;
      |    ^~~~
a.cc:93:20: error: reference to 'size' is ambiguous
   93 |         size=pow(2,size+1)-1;
      |                    ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:28:4: note:                 'll size'
   28 | ll size;
      |    ^~~~
a.cc:94:15: error: reference to 'size' is ambiguous
   94 |         rep(i,size){
      |               ^~~~
a.cc:16:33: note: in definition of macro 'rep'
   16 | #define rep(i,n) for(int i=0;i<(n);++i)
      |                                 ^
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:28:4: note:                 'll size'
   28 | ll size;
      |    ^~~~
a.cc:95:22: error: 'INT_MAX' was not declared in this scope
   95 |                 v.pb(INT_MAX);
      |                      ^~~~~~~
a.cc:20:25: note: in definition of macro 'pb'
   20 | #define pb(a) push_back(a)
      |                         ^
a.cc:10:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    9 | #include <queue>
  +++ |+#include <climits>
   10 | #include <time.h>