Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll, ll>;
using Pld = pair<ld, ld>;
using Vec = vector<ll>;
using VecP = vector<P>;
using VecB = vector<bool>;
using VecC = vector<char>;
using VecD = vector<ld>;
using VecS = vector<string>;
using VecVec = vector<Vec>;
using Graph = vector<VecP>;
template <typename T>
using Vec1 = vector<T>;
template <typename T>
using Vec2 = vector<Vec1<T> >;
#define REP(i, m, n) for(ll (i) = (m); (i) < (n); ++(i))
#define REPN(i, m, n) for(ll (i) = (m); (i) <= (n); ++(i))
#define REPR(i, m, n) for(ll (i) = (m)-1; (i) >= (n); --(i))
#define REPNR(i, m, n) for(ll (i) = (m); (i) >= (n); --(i))
#define rep(i, n) REP(i, 0, n)
#define repn(i, n) REPN(i, 1, n)
#define repr(i, n) REPR(i, n, 0)
#define repnr(i, n) REPNR(i, n, 1)
#define all(s) (s).begin(), (s).end()
#define pb push_back
#define mp make_pair
#define fs first
#define sc second
template <typename T>
bool chmax(T &a, const T& b){if(a < b){a = b; return true;} return false;}
template <typename T>
bool chmin(T &a, const T& b){if(a > b){a = b; return true;} return false;}
template <typename T>
void co(const T n){cout << n << endl;}
template <typename T>
void cosp(const T n){cout << n << ' ';}
template <typename T>
void coVec(const Vec &v){for(ll i : v) cosp(i); cout << endl;}
void sonic(){ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);}
void setp(const ll n){cout << fixed << setprecision(n);}
const ll INF = 1e9+1;
const ll LINF = 1e18+1;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const ld PI = acos(-1);
const ld EPS = 1e-11;

//range : 0 ~ n-1
template <typename T>
struct SegmentTree{
	using F = function<T(T, T)>;
	T n;
	F f;
	Vec1<T> data;

	T N = 1;
	SegmentTree(T n, F f) : f(f){
		while(N < n) N <<= 1;
		data.assign(N*2, LINF);
	}

	void build(Vec1<T> v){
		rep(i, v.size()) data[N+i] = v[i];
		repnr(i, N-1) data[i] = f(data[i*2], data[i*2+1]);
	}

	void update(T k, const T x){
		k += N;
		data[k] = x;
		while(k > 1){
			k >>= 1;
			data[k] = f(data[k*2], data[k*2+1]);
		}
	}

	T query(T a, T b){return query(a, b, 1LL, 0LL, N);}
	T query(T a, T b, T k, T l, T r){
		if(r <= a || b <= l) return LINF;
		if(a <= l && r <= b) return data[k];
		T m = (l+r)/2;
		return f(query(a, b, k*2, l, m), query(a, b, k*2+1, m, r));
	}
};

int main(void){
	ll n, q;
	cin >> n >> q;
	Vec a(n, (1LL << 31)-1);

	SegmentTree<ll> st(n, [](ll a, ll, b){return min(a, b)});
	st.build(a);

	ll com, x, y;
	rep(i, q){
		cin >> com >> x >> y;
		if(!com){
			st.update(x, y);
		}else{
			co(st.query(x, y+1));
		}
	}

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:93:44: error: 'b' has not been declared
   93 |         SegmentTree<ll> st(n, [](ll a, ll, b){return min(a, b)});
      |                                            ^
a.cc: In lambda function:
a.cc:93:61: error: 'b' was not declared in this scope
   93 |         SegmentTree<ll> st(n, [](ll a, ll, b){return min(a, b)});
      |                                                             ^
a.cc:93:63: error: expected ';' before '}' token
   93 |         SegmentTree<ll> st(n, [](ll a, ll, b){return min(a, b)});
      |                                                               ^
      |                                                               ;
a.cc: In function 'int main()':
a.cc:93:64: error: no matching function for call to 'SegmentTree<long long int>::SegmentTree(ll&, main()::<lambda(ll, ll, int)>)'
   93 |         SegmentTree<ll> st(n, [](ll a, ll, b){return min(a, b)});
      |                                                                ^
a.cc:60:9: note: candidate: 'SegmentTree<T>::SegmentTree(T, F) [with T = long long int; F = std::function<long long int(long long int, long long int)>]'
   60 |         SegmentTree(T n, F f) : f(f){
      |         ^~~~~~~~~~~
a.cc:60:28: note:   no known conversion for argument 2 from 'main()::<lambda(ll, ll, int)>' to 'SegmentTree<long long int>::F' {aka 'std::function<long long int(long long int, long long int)>'}
   60 |         SegmentTree(T n, F f) : f(f){
      |                          ~~^
a.cc:53:8: note: candidate: 'SegmentTree<long long int>::SegmentTree(const SegmentTree<long long int>&)'
   53 | struct SegmentTree{
      |        ^~~~~~~~~~~
a.cc:53:8: note:   candidate expects 1 argument, 2 provided
a.cc:53:8: note: candidate: 'SegmentTree<long long int>::SegmentTree(SegmentTree<long long int>&&)'
a.cc:53:8: note:   candidate expects 1 argument, 2 provided