Language: C++

#ifndef ___Class_RMQ
#define ___Class_RMQ

// ------ Required ------ //
#include <limits>
#include <vector>
#include <algorithm>

// ------ RMQ Class ------ //
template<typename Type> class RMQ {
private:
	unsigned size_; std::vector<Type> dat;
	Type query_(unsigned a, unsigned b, unsigned k, unsigned l, unsigned r) {
		if (r <= a || b <= l) return RMQ<Type>::inf;
		if (a <= l && r <= b) return dat[k];
		Type lc = query_(a, b, (k << 1), l, (l + r) >> 1);
		Type rc = query_(a, b, (k << 1) + 1U, (l + r) >> 1, r);
		return min(lc, rc);
	}
public:
	static const Type inf = std::numeric_limits<Type>::max();
	RMQ() : size_(0U), dat(std::vector<Type>()) {};
	RMQ(int size__) {
		for (size_ = 1U; size_ < size__; ) size_ <<= 1;
		dat.resize(size_ << 1, RMQ<Type>::inf);
	}
	template<class T>
	RMQ(T begin_, T end_) {
		sted::unsigned n = (end_ - begin_);
		for (size_ = 1; size_ < n; size_ <<= 1); dat.resize(size_ << 1, RMQ<Type>::inf);
		for (unsigned i = 0U; i < n; i++) dat[i + size_] = *(begin_ + i);
		for (unsigned i = size_ - 1U; i > 0U; i--) dat[i] = std::min(dat[i << 1], dat[(i << 1) + 1]);
	}
	unsigned size() { return size_; }
	void update(unsigned i, Type x) {
		i += size_; dat[i] = x;
		while (i > 1U) i >>= 1, dat[i] = std::min(dat[i << 1], dat[(i << 1) + 1]);
	}
	Type query(unsigned l, unsigned r) {
		return query_(l, r, 1U, 0U, size_);
	}
};

#endif

int n, q, c, x, y;
int main() {
	scanf("%d%d", &n, &q);
	RMQ<int> Q(n);
	while(q--) {
		scanf("%d%d%d", &c, &x, &y);
		if(c == 0) Q.update(x, y);
		else printf("%d\n", Q.query(x, y + 1));
	}
}

Compiler output:
a.cc: In constructor 'RMQ<Type>::RMQ(T, T)':
a.cc:29:17: error: 'sted' has not been declared
   29 |                 sted::unsigned n = (end_ - begin_);
      |                 ^~~~
a.cc:29:23: error: expected unqualified-id before 'unsigned'
   29 |                 sted::unsigned n = (end_ - begin_);
      |                       ^~~~~~~~
a.cc:30:41: error: 'n' was not declared in this scope
   30 |                 for (size_ = 1; size_ < n; size_ <<= 1); dat.resize(size_ << 1, RMQ<Type>::inf);
      |                                         ^
a.cc:31:43: error: 'n' was not declared in this scope
   31 |                 for (unsigned i = 0U; i < n; i++) dat[i + size_] = *(begin_ + i);
      |                                           ^
a.cc: In function 'int main()':
a.cc:48:9: error: 'scanf' was not declared in this scope
   48 |         scanf("%d%d", &n, &q);
      |         ^~~~~
a.cc:53:22: error: 'printf' was not declared in this scope
   53 |                 else printf("%d\n", Q.query(x, y + 1));
      |                      ^~~~~~
a.cc:8:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    7 | #include <algorithm>
  +++ |+#include <cstdio>
    8 | 
a.cc: In instantiation of 'Type RMQ<Type>::query_(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) [with Type = int]':
a.cc:40:10:   required from 'Type RMQ<Type>::query(unsigned int, unsigned int) [with Type = int]'
   40 |                 return query_(l, r, 1U, 0U, size_);
      |                        ^~~~~~
a.cc:53:30:   required from here
   53 |                 else printf("%d\n", Q.query(x, y + 1));
      |                                     ~~~~~~~^~~~~~~~~~
a.cc:18:27: error: 'min' was not declared in this scope; did you mean 'std::min'?
   18 |                 return min(lc, rc);
      |                        ~~~^~~~~~~~
      |                        std::min
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:7:
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~