criyle/codenet-compile-errors huggingface dataset:
Language: C++

class Seg
  def initialize ( n, init, &func)
    @tree = Array.new( 2**n - 1, init )
    @init = init
    @n    = n
    @func = func || lambda{|x,y| x < y}
  end

  def update (i, x)
    i = 2**(@n-1) - 1 + i
    @tree[i] = x

    while (i=parent(i))>=0
      a,b = @tree[i], x
      @tree[i] = @func.call(@tree[i], x) ? @tree[i] : x
    end

  end

  def find ( s, t, k=0, i=0, j=@n-1 )
    return @init if t<i || j<s
    return @tree[k] if s<=i && j<=t

    a, b = kids(k)
    a, b = find(s, t, a, i, (i+j)/2), find(s, t, b, (i+j)/2+1, j)
    @func.call(a, b) ? a : b
  end

  private
  def parent(i)
    (i-1)/2
  end

  def kids(i)
    [2*i+1, 2*i+2]
  end
end

n, q = gets.split.map(&:to_i)
i = 1
while (2**i-1) < n
  i += 1
end

seg  = Seg.new(n, 2**31-1) { |x,y| x < y }
q.times do
  com, x, y = gets.split.map(&:to_i)

  case com
  when 0
    seg.update(x, y)
  when 1
    puts seg.find(x,y)
  end
end

Compiler output:
a.cc:3:5: error: stray '@' in program
    3 |     @tree = Array.new( 2**n - 1, init )
      |     ^
a.cc:4:5: error: stray '@' in program
    4 |     @init = init
      |     ^
a.cc:5:5: error: stray '@' in program
    5 |     @n    = n
      |     ^
a.cc:6:5: error: stray '@' in program
    6 |     @func = func || lambda{|x,y| x < y}
      |     ^
a.cc:10:13: error: stray '@' in program
   10 |     i = 2**(@n-1) - 1 + i
      |             ^
a.cc:11:5: error: stray '@' in program
   11 |     @tree[i] = x
      |     ^
a.cc:14:13: error: stray '@' in program
   14 |       a,b = @tree[i], x
      |             ^
a.cc:15:7: error: stray '@' in program
   15 |       @tree[i] = @func.call(@tree[i], x) ? @tree[i] : x
      |       ^
a.cc:15:18: error: stray '@' in program
   15 |       @tree[i] = @func.call(@tree[i], x) ? @tree[i] : x
      |                  ^
a.cc:15:29: error: stray '@' in program
   15 |       @tree[i] = @func.call(@tree[i], x) ? @tree[i] : x
      |                             ^
a.cc:15:44: error: stray '@' in program
   15 |       @tree[i] = @func.call(@tree[i], x) ? @tree[i] : x
      |                                            ^
a.cc:20:32: error: stray '@' in program
   20 |   def find ( s, t, k=0, i=0, j=@n-1 )
      |                                ^
a.cc:21:12: error: stray '@' in program
   21 |     return @init if t<i || j<s
      |            ^
a.cc:22:12: error: stray '@' in program
   22 |     return @tree[k] if s<=i && j<=t
      |            ^
a.cc:26:5: error: stray '@' in program
   26 |     @func.call(a, b) ? a : b
      |     ^
a.cc:2:7: error: expected initializer before 'initialize'
    2 |   def initialize ( n, init, &func)
      |       ^~~~~~~~~~
a.cc:7:3: error: 'end' does not name a type
    7 |   end
      |   ^~~
a.cc:46:1: error: 'q' does not name a type
   46 | q.times do
      | ^
Language: C++

#include <iostream>
#include <algorithm>
#include <memory>

template <class M>
class segtree {
    private:
        using value_type = typename M::value_type;
        value_type value;
        std::unique_ptr<segtree> lch, rch;
        int size;
        M append;
    public:
        segtree(int n) : value(M::init), size(n) {
            if (n <= 1) return;
            lch.reset(new segtree(n / 2));
            rch.reset(new segtree(n - n / 2));
        }
        value_type range_query(int a, int b) {
            if (a <= 0 && size <= b) return value;
            if (b <= 0 || size <= a) return M::init;
            int lsize = lch->size;
            auto left = lch->range_query(a, b),
                 right = rch->range_query(a - lsize, b - lsize);
            return append(left, right);
        }
        void update(int k, value_type x) {
            if (!lch && !rch) {
                value = x;
                return;
            }
            else if (k < lch->size) lch->update(k, x);
            else rch->update(k - lch->size, x);
            value = append(lch->value, rch->value);
        }
};

struct MinInt {
    using value_type = int;
    static constexpr value_type init = std::numeric_limits<int>::max();
    int operator() (int a, int b) const {
        return std::min(a, b);
    }
};

enum command { Update, Find, };

int main() {
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(nullptr);
    int n, q;
    std::cin >> n >> q;
    segtree<MinInt> rmq(n);
    for (auto i = 0; i < q; i++) {
        int com, x, y;
        std::cin >> com >> x >> y;
        switch (com) {
            case Update:
                rmq.update(x, y);
                break;
            case Find:
                std::cout << rmq.range_query(x, y + 1) << '\n';
                break;
        }
    }
    return 0;
}

Compiler output:
a.cc:40:45: error: 'numeric_limits' is not a member of 'std'
   40 |     static constexpr value_type init = std::numeric_limits<int>::max();
      |                                             ^~~~~~~~~~~~~~
a.cc:40:60: error: expected primary-expression before 'int'
   40 |     static constexpr value_type init = std::numeric_limits<int>::max();
      |                                                            ^~~
a.cc:40:59: error: expected ';' at end of member declaration
   40 |     static constexpr value_type init = std::numeric_limits<int>::max();
      |                                                           ^
      |                                                            ;
a.cc:40:63: error: expected unqualified-id before '>' token
   40 |     static constexpr value_type init = std::numeric_limits<int>::max();
      |                                                               ^
Language: C++

#ifndef ___Class_RMQ
#define ___Class_RMQ

#include <cmath>
#include <vector>
#include <algorithm>

using namespace std;

class RMQ
{
private:

	vector<long long> data; int size;

	long long find(int a, int b, int k, int l, int r);

public:

	static const long long INFTY = 1LL << 60;

	RMQ(int size_)
	{
		int x = (int)(ceil(log2(size_))) + 1;

		size = (int)(pow(2, x));

		data.resize(size * 2, INFTY);
	}

	void update(int i, long long x);
	
	long long query(int s, int t);
};

void RMQ::update(int i, long long x)
{
	i += size - 1;

	data[i] = x;

	while (i > 0)
	{
		i = (i - 1) / 2;

		data[i] = min(data[2 * i + 1], data[2 * i + 2]);
	}
}

long long RMQ::find(int a, int b, int k, int l, int r)
{
	if (r <= a || b <= l) { return INFTY; }

	if (a <= l && r <= b) { return data[k]; }

	else
	{
		long long vl = find(a, b, 2 * k + 1, l, (l + r) / 2);
		long long vr = find(a, b, 2 * k + 2, (l + r) / 2, r);

		return min(vl, vr);
	}
}

long long RMQ::query(int s, int t)
{
	return find(s, t, 0, 0, size);
}

#endif


// ------ main ------ //

#include <iostream>

using namespace std;

int n, q, com, x, y;

int main()
{
	cin >> n >> q;

	RMQ r(n);

	for (int i = 0; i < q; i++)
	{
		cin >> com >> x >> y;

		if (com == 0) { r.update(x, y); }
		if (com == 1) { cout << (r.query(x, y) == RMQ::INFTY ? 1LL << 31 - 1 : r.query(x, y)) << endl; }
	}

	return 0;
}

Compiler output:
/usr/bin/ld: /tmp/ccFtSifH.o: warning: relocation against `_ZN3RMQ5INFTYE' in read-only section `.text._ZN3RMQC2Ei[_ZN3RMQC5Ei]'
/usr/bin/ld: /tmp/ccFtSifH.o: in function `RMQ::RMQ(int)':
a.cc:(.text._ZN3RMQC2Ei[_ZN3RMQC5Ei]+0x6c): undefined reference to `RMQ::INFTY'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
Language: C++

#include <cmath>
#include <vector>
#include <algorithm>

using namespace std;

class RMQ
{
private:

	vector<long long> data; int size;

	long long find(int a, int b, int k, int l, int r);

public:

	static const long long INFTY = 1LL << 60;

	RMQ(int size_)
	{
		int x = (int)(ceil(log2(size_))) + 1;

		size = (int)(pow(2, x));

		data.resize(size * 2, INFTY);
	}

	void update(int i, long long x);
	
	long long query(int s, int t);
};

void RMQ::update(int i, long long x)
{
	i += size - 1;

	data[i] = x;

	while (i > 0)
	{
		i = (i - 1) / 2;

		data[i] = min(data[2 * i + 1], data[2 * i + 2]);
	}
}

long long RMQ::find(int a, int b, int k, int l, int r)
{
	if (r <= a || b <= l) { return INFTY; }

	if (a <= l && r <= b) { return data[k]; }

	else
	{
		long long vl = find(a, b, 2 * k + 1, l, (l + r) / 2);
		long long vr = find(a, b, 2 * k + 2, (l + r) / 2, r);

		return min(vl, vr);
	}
}

long long RMQ::query(int s, int t)
{
	return find(s, t, 0, 0, size);
}


// ------ main ------ //

#include <iostream>

using namespace std;

int n, q, com, x, y;

int main()
{
	cin >> n >> q;

	RMQ r(n);

	for (int i = 0; i < q; i++)
	{
		cin >> com >> x >> y;

		if (com == 0) { r.update(x, y); }
		if (com == 1) { cout << (r.query(x, y) == RMQ::INFTY ? 1LL << 31 - 1 : r.query(x, y)) << endl; }
	}

	return 0;
}

Compiler output:
/usr/bin/ld: /tmp/ccYy4VGh.o: warning: relocation against `_ZN3RMQ5INFTYE' in read-only section `.text._ZN3RMQC2Ei[_ZN3RMQC5Ei]'
/usr/bin/ld: /tmp/ccYy4VGh.o: in function `RMQ::RMQ(int)':
a.cc:(.text._ZN3RMQC2Ei[_ZN3RMQC5Ei]+0x6c): undefined reference to `RMQ::INFTY'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
Language: C++

#ifndef ___Class_RMQ
#define ___Class_RMQ

#include <cmath>
#include <vector>
#include <algorithm>

using namespace std;

class RMQ
{
private:

	vector<long long> data; int size;

	long long find(int a, int b, int k, int l, int r);

public:

	static const long long INFTY = 1LL << 60;

	RMQ(int size_)
	{
		int x = (int)(ceil(log2(size_))) + 1;

		size = (int)(pow(2, x));

		data.resize(size * 2, INFTY);
	}

	void update(int i, long long x);
	
	long long query(int s, int t);
};

void RMQ::update(int i, long long x)
{
	i += size - 1;

	data[i] = x;

	while (i > 0)
	{
		i = (i - 1) / 2;

		data[i] = min(data[2 * i + 1], data[2 * i + 2]);
	}
}

long long RMQ::find(int a, int b, int k, int l, int r)
{
	if (r <= a || b <= l) { return INFTY; }

	if (a <= l && r <= b) { return data[k]; }

	else
	{
		long long vl = find(a, b, 2 * k + 1, l, (l + r) / 2);
		long long vr = find(a, b, 2 * k + 2, (l + r) / 2, r);

		return min(vl, vr);
	}
}

long long RMQ::query(int s, int t)
{
	return find(s, t, 0, 0, size);
}

#endif


// ------ main ------ //

#include <iostream>

using namespace std;

int n, q, com, x, y;

int main()
{
	cin >> n >> q;

	RMQ r(n);

	for (int i = 0; i < q; i++)
	{
		cin >> com >> x >> y;

		if (com == 0) { r.update(x, y); }
		if (com == 1) { cout << (r.query(x, y) == (1LL << 60) ? 1LL << 31 - 1 : r.query(x, y)) << endl; }
	}

	return 0;
}

Compiler output:
/usr/bin/ld: /tmp/ccVrV0VC.o: warning: relocation against `_ZN3RMQ5INFTYE' in read-only section `.text._ZN3RMQC2Ei[_ZN3RMQC5Ei]'
/usr/bin/ld: /tmp/ccVrV0VC.o: in function `RMQ::RMQ(int)':
a.cc:(.text._ZN3RMQC2Ei[_ZN3RMQC5Ei]+0x6c): undefined reference to `RMQ::INFTY'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
Language: C++

#ifndef ___Class_RMQ
#define ___Class_RMQ

#include <cmath>
#include <vector>
#include <algorithm>

using namespace std;

class RMQ
{
private:

	vector<long long> data; int size;

	long long find(int a, int b, int k, int l, int r);

public:

	static const long long INF = 1LL << 60;

	RMQ(int size_)
	{
		int x = (int)(ceil(log2(size_))) + 1;

		size = (int)(pow(2, x));

		data.resize(size * 2, INFTY);
	}

	void update(int i, long long x);
	
	long long query(int s, int t);
};

void RMQ::update(int i, long long x)
{
	i += size - 1;

	data[i] = x;

	while (i > 0)
	{
		i = (i - 1) / 2;

		data[i] = min(data[2 * i + 1], data[2 * i + 2]);
	}
}

long long RMQ::find(int a, int b, int k, int l, int r)
{
	if (r <= a || b <= l) { return INFTY; }

	if (a <= l && r <= b) { return data[k]; }

	else
	{
		long long vl = find(a, b, 2 * k + 1, l, (l + r) / 2);
		long long vr = find(a, b, 2 * k + 2, (l + r) / 2, r);

		return min(vl, vr);
	}
}

long long RMQ::query(int s, int t)
{
	return find(s, t, 0, 0, size);
}

#endif


// ------ main ------ //

#include <iostream>

using namespace std;

int n, q, com, x, y;

int main()
{
	cin >> n >> q;

	RMQ r(n);

	for (int i = 0; i < q; i++)
	{
		cin >> com >> x >> y;

		if (com == 0) { r.update(x, y); }
		if (com == 1) { cout << (r.query(x, y) == (1LL << 60) ? 1LL << 31 - 1 : r.query(x, y)) << endl; }
	}

	return 0;
}

Compiler output:
a.cc: In constructor 'RMQ::RMQ(int)':
a.cc:28:39: error: 'INFTY' was not declared in this scope; did you mean 'INF'?
   28 |                 data.resize(size * 2, INFTY);
      |                                       ^~~~~
      |                                       INF
a.cc: In member function 'long long int RMQ::find(int, int, int, int, int)':
a.cc:52:40: error: 'INFTY' was not declared in this scope; did you mean 'INF'?
   52 |         if (r <= a || b <= l) { return INFTY; }
      |                                        ^~~~~
      |                                        INF
Language: C++

#ifndef ___Class_RMQ
#define ___Class_RMQ

#include <cmath>
#include <vector>
#include <algorithm>

using namespace std;

class RMQ
{
private:

	vector<long long> data; int size;

	long long find(int a, int b, int k, int l, int r);

public:

	static const long long INF = 1LL << 60;

	RMQ(int size_)
	{
		int x = (int)(ceil(log2(size_))) + 1;

		size = (int)(pow(2, x));

		data.resize(size * 2, INF);
	}

	void update(int i, long long x);
	
	long long query(int s, int t);
};

void RMQ::update(int i, long long x)
{
	i += size - 1;

	data[i] = x;

	while (i > 0)
	{
		i = (i - 1) / 2;

		data[i] = min(data[2 * i + 1], data[2 * i + 2]);
	}
}

long long RMQ::find(int a, int b, int k, int l, int r)
{
	if (r <= a || b <= l) { return INF; }

	if (a <= l && r <= b) { return data[k]; }

	else
	{
		long long vl = find(a, b, 2 * k + 1, l, (l + r) / 2);
		long long vr = find(a, b, 2 * k + 2, (l + r) / 2, r);

		return min(vl, vr);
	}
}

long long RMQ::query(int s, int t)
{
	return find(s, t, 0, 0, size);
}

#endif


// ------ main ------ //

#include <iostream>

using namespace std;

int n, q, com, x, y;

int main()
{
	cin >> n >> q;

	RMQ r(n);

	for (int i = 0; i < q; i++)
	{
		cin >> com >> x >> y;

		if (com == 0) { r.update(x, y); }
		if (com == 1) { cout << (r.query(x, y) == (1LL << 60) ? 1LL << 31 - 1 : r.query(x, y)) << endl; }
	}

	return 0;
}

Compiler output:
/usr/bin/ld: /tmp/ccwExHo0.o: warning: relocation against `_ZN3RMQ3INFE' in read-only section `.text._ZN3RMQC2Ei[_ZN3RMQC5Ei]'
/usr/bin/ld: /tmp/ccwExHo0.o: in function `RMQ::RMQ(int)':
a.cc:(.text._ZN3RMQC2Ei[_ZN3RMQC5Ei]+0x6c): undefined reference to `RMQ::INF'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
Language: C++

#ifndef ___Class_RMQ
#define ___Class_RMQ

#include <vector>

using namespace std;

template <typename Type> class RMQ
{
private:

	int size;

	vector<Type> minvalue;

	Type _query(int a, int b, int k, int l, int r)
	{
		if (r <= a || b <= l) { return INF; }
		if (a <= l && r <= b) { return minvalue[k]; }

		Type vl = _query(a, b, 2 * k, l, (l + r) / 2);
		Type vr = _query(a, b, 2 * k + 1, (l + r) / 2, r);

		return min(vl, vr);
	}

public:

	Type INF;

	RMQ(int size_)
	{
		INF = numeric_limits<Type>::max();

		for (size = 1; size < size_;) { size <<= 1; }

		minvalue = vector<Type>(size * 2, INF);
	}

	void update(int i, const Type& x)
	{
		i += size;

		minvalue[i] = x;

		while (i > 1)
		{
			i = i / 2;

			minvalue[i] = min(minvalue[2 * i], minvalue[2 * i + 1]);
		}
	}

	Type query(int s, int t)
	{
		return _query(s, t, 1, 0, size);
	}
};

#endif


// ------ main ------ //

#include <cstdio>

#pragma warning(disable: 4996)

int n, q, com, x, y;

int main()
{
	scanf("%d", &n);
	scanf("%d", &q);

	RMQ<int> r(n);

	for (int i = 0; i < q; i++)
	{
		scanf("%d", &com);
		scanf("%d", &x);
		scanf("%d", &y);

		if (com == 0) 
		{
			r.update(x, y);
		}
		if (com == 1) 
		{
			printf("%lld\n", r.query(x, y + 1));
		}
	}

	return 0;
}

Compiler output:
a.cc: In constructor 'RMQ<Type>::RMQ(int)':
a.cc:33:23: error: 'numeric_limits' was not declared in this scope
   33 |                 INF = numeric_limits<Type>::max();
      |                       ^~~~~~~~~~~~~~
a.cc:33:42: error: expected primary-expression before '>' token
   33 |                 INF = numeric_limits<Type>::max();
      |                                          ^
a.cc:33:48: error: no matching function for call to 'max()'
   33 |                 INF = numeric_limits<Type>::max();
      |                                           ~~~~~^~
In file included from /usr/include/c++/14/vector:62,
                 from a.cc:4:
/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:   candidate expects 2 arguments, 0 provided
/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, 0 provided
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <string>
#include <tuple>
#include <functional>
#include <numeric>
#include <cmath>
#include <iomanip>
#include <map>
//#include "toollib.h"
#pragma warning (disable:4018)
using namespace std;

vector<int> ret;

int min_in_ary(vector<int> ary) {
	sort(ary.begin(), ary.end());
	return ary[0];
}

void update(vector<int>* a, int x, int y) {
	(*a)[x] = y;
}

void find(vector<int>* a, int x, int y) {
	vector<int> ary;
	for (int i = x; i <= y; i++) ary.push_back((*a)[i]);
	ret.push_back(min_in_ary(ary));
}

int main() {
	int n, q;
	cin >> n >> q;
	vector<int> a(n, INT_MAX);
	for (int i = 0; i < q; i++) {
		int com, x, y;
		cin >> com >> x >> y;
		if (com == 0) update(&a, x, y);
		else find(&a, x, y);
	}
	for (int i = 0; i < ret.size(); i++) {
		cout << ret[i] << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:26: error: 'INT_MAX' was not declared in this scope
   36 |         vector<int> a(n, INT_MAX);
      |                          ^~~~~~~
a.cc:12:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   11 | #include <map>
  +++ |+#include <climits>
   12 | //#include "toollib.h"
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <string>
#include <tuple>
#include <functional>
#include <numeric>
#include <cmath>
#include <iomanip>
#include <map>
//#include "toollib.h"
#pragma warning (disable:4018)
using namespace std;

vector<int> ret;

void update(vector<int>* a, int x, int y) {
	(*a)[x] = y;
}

void find(vector<int> a, int x, int y) {
	sort(a.begin() + x, a.begin() + y + 1);
	ret.push_back(a[x]);
}

int main() {
	int n, q;
	int find_x = -1, find_y = -1;
	cin >> n >> q;
	vector<int> a(n, 2147483647);
	for (int i = 0; i < q; i++) {
		int com, x, y;
		cin >> com >> x >> y;
		if (com == 0) {
			update(&a, x, y);
			find_x = -1;
			find_y = -1;
		}
		else{
			if (x == find_x && y == find_y) ret.push_back(ret.back());
			else {
				find(a, x, y);
				find_x = x;
				find_y = y;
			}
	}
	for (int i = 0; i < ret.size(); i++) {
		cout << ret[i] << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:2: error: expected '}' at end of input
   52 | }
      |  ^
a.cc:27:12: note: to match this '{'
   27 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<b;i++)
typedef long long ll;

// V??????, NV???????´???°, def????????????, comp???????????¢??°
template<class V, int NV> class SegTree {
public:
	vector<V> val;
	static V const def = (1<<31)-1;
	V comp(V l, V r) { return min(l, r); };

	SegTree() { val = vector<V>(NV * 2, def); };
	V getval(int x, int y, int l = 0, int r = NV, int k = 1) {	// [x,y)
		if (r <= x || y <= l) return def;
		if (x <= l && r <= y) return val[k];
		return comp(getval(x, y, l, (l + r) / 2, k * 2), getval(x, y, (l + r) / 2, r, k * 2 + 1));
	}
	void update(int entry, V v) {
		entry += NV;
		val[entry] = v;
		while (entry>1) entry >>= 1, val[entry] = comp(val[entry * 2], val[entry * 2 + 1]);
	}
};

int main()
{
	int n, q; cin >> n >> q;
	SegTree<ll, 1<<20> st;
	rep(i, 0, q)
	{
		int c, x;
		ll y;
		cin >> c >> x >> y;

		if (c == 0)
		{
			st.update(x, y);
		}
		else
		{
			cout << st.getval(x, y+1) << endl;
		}
	}
}

Compiler output:
a.cc: In instantiation of 'const long long int SegTree<long long int, 1048576>::def':
a.cc:13:38:   required from 'SegTree<V, NV>::SegTree() [with V = long long int; int NV = 1048576]'
   13 |         SegTree() { val = vector<V>(NV * 2, def); };
      |                                             ^~~
a.cc:29:21:   required from here
   29 |         SegTree<ll, 1<<20> st;
      |                            ^~
a.cc:10:37: warning: integer overflow in expression of type 'int' results in '2147483647' [-Woverflow]
   10 |         static V const def = (1<<31)-1;
      |                              ~~~~~~~^~
a.cc:10:37: error: overflow in constant expression [-fpermissive]
a.cc:10:24: error: overflow in constant expression [-fpermissive]
   10 |         static V const def = (1<<31)-1;
      |                        ^~~
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
class RMQ {
	int size_, dat[];
	int query_(int a, int b, int k, int l, int r) {
		if(r <= a || b <= l) return 2147483647;
		if(a <= l && r <= b) return dat[k];
		int lc = query_(a, b, 2 * k, l, (l + r) / 2);
		int rc = query_(a, b, 2 * k + 1, (l + r) / 2, r);
		return min(lc, rc);
	}
	RMQ(int s) {
		for(size_ = 1; size_ < s;) size_ *= 2;
		dat = new int[size_ * 2];
		for(int i = 0; i < size_ * 2; i++) dat[i] = 2147483647;
	}
	void update(int pos, int x) {
		pos += size_; dat[pos] = x;
		while(pos > 1) {
			pos /= 2;
			dat[pos] = min(dat[2 * pos], dat[2 * pos + 1]);
		}
	}
	int query(int l, int r) {
		return query_(l, r, 1, 0, size_);
	}
}
int n, q, c, x, y;
int main {
	scanf("%d%d", &n, &q);
	RMQ r(n);
	for(int i = 0; i < q; i++) {
		scanf("%d%d%d", &c, &x, &y);
		if(c == 0) r.update(x, y);
		else printf("%d\n", r.query(x, y + 1));
	}
}

Compiler output:
a.cc:28:2: error: expected ';' after class definition
   28 | }
      |  ^
      |  ;
a.cc: In constructor 'RMQ::RMQ(int)':
a.cc:15:17: error: invalid use of array with unspecified bounds
   15 |                 dat = new int[size_ * 2];
      |                 ^~~
a.cc: At global scope:
a.cc:30:5: error: cannot declare '::main' to be a global variable
   30 | int main {
      |     ^~~~
a.cc:31:30: error: expected '}' before ';' token
   31 |         scanf("%d%d", &n, &q);
      |                              ^
a.cc:30:10: note: to match this '{'
   30 | int main {
      |          ^
a.cc:32:16: error: 'RMQ::RMQ(int)' is private within this context
   32 |         RMQ r(n);
      |                ^
a.cc:13:9: note: declared private here
   13 |         RMQ(int s) {
      |         ^~~
a.cc:33:9: error: expected unqualified-id before 'for'
   33 |         for(int i = 0; i < q; i++) {
      |         ^~~
a.cc:33:24: error: 'i' does not name a type
   33 |         for(int i = 0; i < q; i++) {
      |                        ^
a.cc:33:31: error: 'i' does not name a type
   33 |         for(int i = 0; i < q; i++) {
      |                               ^
a.cc:38:1: error: expected declaration before '}' token
   38 | }
      | ^
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
int n, q, c, x, y, size_, dat[262144];
void update(int pos, int x) {
	pos += size_; dat[pos] = x;
	while(pos > 1) {
		pos /= 2;
		dat[pos] = min(dat[2 * pos], dat[2 * pos + 1]);
	}
}
int query_(int a, int b, int k, int l, int r) {
	if(r <= a || b <= l) return 2147483647;
	if(a <= l && r <= b) return dat[k];
	int lc = query_(a, b, 2 * k, l, (l + r) / 2);
	int rc = query_(a, b, 2 * k + 1, (l + r) / 2, r);
	return min(lc, rc);
}
int main() {
	scanf("%d%d", &n, &q);
	for(size_ = 1; size_ < n;) size_ *= 2;
	for(int i = 0; i < size_ * 2; i++) dat[i] = 2147483647;
	for(int i = 0; i < q; i++) {
		scanf("%d%d%d", &c, &x, &y);
		if(c == 0) r.update(x, y);
		else printf("%d\n", r.query(x, y + 1, 1, 0, size_));
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:28: error: 'r' was not declared in this scope
   25 |                 if(c == 0) r.update(x, y);
      |                            ^
a.cc:26:37: error: 'r' was not declared in this scope
   26 |                 else printf("%d\n", r.query(x, y + 1, 1, 0, size_));
      |                                     ^
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
int n, q, c, x, y, size_, dat[262144];
void update(int pos, int x) {
	pos += size_; dat[pos] = x;
	while(pos > 1) {
		pos /= 2;
		dat[pos] = min(dat[2 * pos], dat[2 * pos + 1]);
	}
}
int query_(int a, int b, int k, int l, int r) {
	if(r <= a || b <= l) return 2147483647;
	if(a <= l && r <= b) return dat[k];
	int lc = query_(a, b, 2 * k, l, (l + r) / 2);
	int rc = query_(a, b, 2 * k + 1, (l + r) / 2, r);
	return min(lc, rc);
}
int main() {
	scanf("%d%d", &n, &q);
	for(size_ = 1; size_ < n;) size_ *= 2;
	for(int i = 0; i < size_ * 2; i++) dat[i] = 2147483647;
	for(int i = 0; i < q; i++) {
		scanf("%d%d%d", &c, &x, &y);
		if(c == 0) update(x, y);
		else printf("%d\n", query(x, y + 1, 1, 0, size_));
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:37: error: 'query' was not declared in this scope; did you mean 'query_'?
   26 |                 else printf("%d\n", query(x, y + 1, 1, 0, size_));
      |                                     ^~~~~
      |                                     query_
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
int n, q, c, x, y, size_, dat[262144];
void update(int pos, int x) {
	pos += size_; dat[pos] = x;
	while(pos > 1) {
		pos /= 2;
		dat[pos] = min(dat[2 * pos], dat[2 * pos + 1]);
	}
}
int query(int a, int b, int k, int l, int r) {
	if(r <= a || b <= l) return 2147483647;
	if(a <= l && r <= b) return dat[k];
	int lc = query_(a, b, 2 * k, l, (l + r) / 2);
	int rc = query_(a, b, 2 * k + 1, (l + r) / 2, r);
	return min(lc, rc);
}
int main() {
	scanf("%d%d", &n, &q);
	for(size_ = 1; size_ < n;) size_ *= 2;
	for(int i = 0; i < size_ * 2; i++) dat[i] = 2147483647;
	for(int i = 0; i < q; i++) {
		scanf("%d%d%d", &c, &x, &y);
		if(c == 0) update(x, y);
		else printf("%d\n", query(x, y + 1, 1, 0, size_));
	}
}

Compiler output:
a.cc: In function 'int query(int, int, int, int, int)':
a.cc:15:18: error: 'query_' was not declared in this scope; did you mean 'query'?
   15 |         int lc = query_(a, b, 2 * k, l, (l + r) / 2);
      |                  ^~~~~~
      |                  query
Language: C++

#include <iostream>
#include <vector>
#include <limits>
using namespace std;

const unsigned int INF = UINT_MAX;

class RangeMinQuery{
private:
	vector< unsigned int > value;
	int _size;
public:
	
	void Init(int size){
		int bitcount = 0;//?????°
		int t = size;
		
		while(t != 0){
			t /= 2;
			++bitcount;
		}
		if(size % (1 << (bitcount - 1)) != 0) bitcount++;
		_size = (1 << bitcount) - 1;
		
		value.resize(_size);
		
		for(vector< unsigned int >::iterator it = value.begin(); it != value.end(); ++it){
			(*it) = INF;
		}
	}
	
	void Update(int index, unsigned int v){
		int n = index + (_size>>1);
		value[n] = v;
		
		while(n > 0){
			n = (n - 1) / 2;
			value[n] = min(value[n * 2 + 1], value[n * 2 + 2]);
		}
	}
	
	unsigned int _RunQuery(int s, int t, int k, int l, int r){
		if(s <= l && r <= t){
			return value[k];
		}
		if(r < s || t < l){
			return INF;
		}
		return min(_RunQuery(s, t, 2 * k + 1, l, (l + r) / 2), _RunQuery(s, t, 2 * k + 2, (l + r) / 2 + 1, r));
	}
	
	unsigned int RunQuery(int s, int t){
		return _RunQuery(s, t, 0, 0, (_size>>1));
	}
};


int main(){
	int n, q;
	int com, x, y;
	RangeMinQuery rmq;
	
	cin >> n >> q;
	rmq.Init(n);
	
	for(int i = 0; i < q; ++i){
		cin >> com >> x >> y;
		
		if(com == 0)rmq.Update(x, y);
		else cout << rmq.RunQuery(x, y) << endl;
	}
}

Compiler output:
a.cc:6:26: error: 'UINT_MAX' was not declared in this scope
    6 | const unsigned int INF = UINT_MAX;
      |                          ^~~~~~~~
a.cc:4:1: note: 'UINT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <limits>
  +++ |+#include <climits>
    4 | using namespace std;
Language: C++

#include<iostream>
using namespace std;
int inf=INT_MAX;
int dat[200001];
int n,q;
void init(int n_){
  n=1;
  while(n < n_) n*=2;
  for(int i=0;i<2*n-1;i++) dat[i]=inf;
}
void update(int k,int a){
  k+=n-1;
  dat[k]=a;
  while(k>0) {
    k=(k-1)/2;
    dat[k]=min(dat[k*2+1],dat[k*2+2]);
  }
}
int query(int a,int b, int k,int l,int r){
  if(a==b) return dat[a];
  if(r<=a||b<=l) return inf;
  if(a<=l && r <= b) return dat[k];
  else{
    int vl=query(a,b,k*2+1,l,(l+r)/2);
    int vr=query(a,b,k*2+2,(l+r)/2,r);
    return min(vl,vr);
  }
}

int find(int x,int y){
  return query(x,y,0,0,n);
}
int main(){
  int n_;
  cin >> n_ >> q;
  init(n_);
  int i,j;
  for(i=0;i<q;i++){
    int com,x,y;
    cin >> com >> x >> y;
    if(com==0) update(x,y);
    else cout << find(x,y) << endl;
    /*
    for(j=0;j<n*2-1;j++) cout << dat[j] << ":";
    cout << endl;
    */
  }
  return 0;
}

Compiler output:
a.cc:3:9: error: 'INT_MAX' was not declared in this scope
    3 | int inf=INT_MAX;
      |         ^~~~~~~
a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    1 | #include<iostream>
  +++ |+#include <climits>
    2 | using namespace std;
Language: C++

#include<iostream>
#include<stdio.h>
using namespace std;

const int MAX_N=100005;

int n,dat[4*MAX_N];

void init(int n_){
	n=1;
	while(n<n_)n*=2;
	for(int i=0;i<2*n-1;i++)dat[i]=INT_MAX;
}

void update(int k,int x){
	k+=n-1;
	dat[k]=x;
	while(k>0){
		k=(k-1)/2;
		dat[k]=min(dat[2*k+1],dat[2*k+2]);
	}
}

int query(int a,int b,int k,int l,int r){
	if(r<=a||b<=l)return INT_MAX;
	if(a<=l && b>=r)return dat[k];
	int vl=query(a,b,2*k+1,l,(l+r)/2);
	int vr=query(a,b,2*k+2,(l+r)/2,r);
	return min(vl,vr);
}

int main(){
	int N,Q;
	cin>>N>>Q;
	init(N);
	for(int i=0;i<Q;i++){
		int c,x,y;
		scanf("%d%d%d",&c,&x,&y);
		if(c==0)update(x,y);
		else printf("%d\n",query(x,y+1,0,0,n));
	}
}

Compiler output:
a.cc: In function 'void init(int)':
a.cc:12:40: error: 'INT_MAX' was not declared in this scope
   12 |         for(int i=0;i<2*n-1;i++)dat[i]=INT_MAX;
      |                                        ^~~~~~~
a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    1 | #include<iostream>
  +++ |+#include <climits>
    2 | #include<stdio.h>
a.cc: In function 'int query(int, int, int, int, int)':
a.cc:25:30: error: 'INT_MAX' was not declared in this scope
   25 |         if(r<=a||b<=l)return INT_MAX;
      |                              ^~~~~~~
a.cc:25:30: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;




#define Seg_Max_N (1<<18) 

using Value = int ;
const Value ini = (1<<31)-1;
struct segtree {
	int N;
	vector<Value>dat;

	segtree() {}
	segtree(int n) :dat(2 * Seg_Max_N) {
		N = 1;
		while (N < n) N *= 2;
		for (int i = 0; i < 2 * N - 1; i++) {
			dat[i] = ini;
		}
	}
	Value connect(const Value&l, const Value&r) {
		return min(l,r)
	}
	// update k th element
	void update(int k, Value a) {
		k += N - 1;
		dat[k] = a;

		while (k > 0) {
			k = (k - 1) / 2;
			const Value al(dat[k * 2 + 1]);
			const Value ar(dat[k * 2 + 2]);
			dat[k] = connect(al, ar);
		}
	}
	// min [a, b)
	Value  query(int a, int b) { return query(a, b, 0, 0, N); }
	Value  query(int a, int b, int k, int l, int r) {
		if (r <= a or b <= l) return ini;
		if (a <= l and r <= b) return dat[k];
		const int m = (l + r) / 2;
		const Value al(query(a, b, k * 2 + 1, l, m));
		const Value ar(query(a, b, k * 2 + 2, m, r));
		return connect(al, ar);
	}
};


int main() {
	int N, Q; cin >> N >> Q;
	segtree seg(N);
	while (Q--) {
		int a, b, c; cin >> a >> b >> c;
		if (a == 0) {
			seg.update(b, c);
		}
		else {
			int ans = seg.query(b, c + 1);
			cout << ans << endl;
		}
	}
	return 0;
}

Compiler output:
a.cc:13:26: warning: integer overflow in expression of type 'int' results in '2147483647' [-Woverflow]
   13 | const Value ini = (1<<31)-1;
      |                   ~~~~~~~^~
a.cc: In member function 'Value segtree::connect(const Value&, const Value&)':
a.cc:28:9: error: expected ';' before '}' token
   28 |         }
      |         ^
Language: C++

#include <iostream>
#include <vector>
#include <cstring>
#include <string>
#include <algorithm>
#include <iomanip>
using namespace std;
#define int long long int

const int MAX_N = 1000010;
const int INF = (1 << 31) - 1;

class MinSeg {
	int n, dat[2 * MAX_N - 1];
public:
	void init(int n_) {
		n = 1;
		while(n < n_) n *= 2;
		for(int i = 0; i < 2 * n - 1; i++) {
			dat[i] = INF;
		}
	}

	void update(int k, int a) {
		k += n - 1;
		dat[k] = a;
		while(k > 0) {
			k = (k - 1) / 2;
			dat[k] = min(dat[k * 2 + 1], dat[k * 2 + 2]);
		}
	}

	int query(int a, int b) {
		return query(a, b, 0, 0, n);
	}

	int query(int a, int b, int k, int l, int r) {
		if(r <= a || b <= l) return INF;
		if(a <= l && r <= b) return dat[k];
		else {
			int vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
			int vr = query(a, b, k * 2 + 2, (l + r) / 2, r);
			return min(vl, vr);
		}
	}
};

MinSeg st;

short main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	int n, q;
	cin >> n >> q;

	st.init(n);

	while(q--) {
		int c, x, y;
		cin >> c >> x >> y;
		if(c == 0) {
			st.update(x, y);
		}
		else {
			cout << st.query(x, y + 1) << endl;;
		}
	}
}

Compiler output:
a.cc:11:27: warning: integer overflow in expression of type 'int' results in '2147483647' [-Woverflow]
   11 | const int INF = (1 << 31) - 1;
      |                 ~~~~~~~~~~^~~
cc1plus: error: '::main' must return 'int'
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) + 1, (l + r) >> 1, r);
		return min(lc, rc);
	}
public:
	static const Type inf = std::numeric_limits<Type>::max();
	RMQ() : size_(0), dat(std::vector<Type>()) {};
	RMQ(int size__) {
		for (size_ = 1; size_ < size__; ) size_ <<= 1;
		dat.resize(size_ << 1, RMQ<Type>::inf);
	}
	template<class T>
	RMQ(T begin_, T end_) {
		unsigned n = (end_ - begin_);
		for (size_ = 1; size_ < n; size_ <<= 1); dat.resize(size_ << 1, RMQ<Type>::inf);
		for (unsigned i = 0; i < n; i++) dat[i + size_] = *(begin_ + i);
		for (unsigned i = size_ - 1; i > 0; 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 > 1) i >>= 1, dat[i] = std::min(dat[i << 1], dat[(i << 1) + 1]);
	}
	Type query(unsigned l, unsigned r) {
		return query_(l, r, 1, 0, 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 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, 1, 0, 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)
      |     ^~~
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) + 1, (l + r) >> 1, r);
		return std::min(lc, rc);
	}
public:
	static const Type inf = std::numeric_limits<Type>::max();
	RMQ() : size_(0), dat(std::vector<Type>()) {};
	RMQ(int size__) {
		for (size_ = 1; size_ < size__; ) size_ <<= 1;
		dat.resize(size_ << 1, RMQ<Type>::inf);
	}
	template<class T>
	RMQ(T begin_, T end_) {
		unsigned n = (end_ - begin_);
		for (size_ = 1; size_ < n; size_ <<= 1); dat.resize(size_ << 1, RMQ<Type>::inf);
		for (unsigned i = 0; i < n; i++) dat[i + size_] = *(begin_ + i);
		for (unsigned i = size_ - 1; i > 0; 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 > 1) i >>= 1, dat[i] = std::min(dat[i << 1], dat[(i << 1) + 1]);
	}
	Type query(unsigned l, unsigned r) {
		return query_(l, r, 1, 0, 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 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 |
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
#include <limits>
#include <functional>
#include <algorithm>

using namespace std;

template<typename T, int VALUE_N>
class SegmentTree {
	const T INIT_VALUE;
	const function<T(T, T)> mergeFunc;
	const int LEAF_N = 1 << (int)(ceil(log2(VALUE_N)));
	const int NODES_N = LEAF_N * 2 - 1;
	vector<T> nodes;
	inline int leafIndex(int i) { return LEAF_N - 1 + i; }
	inline int parentIndex(int i) { return (i - 1) / 2; }
	inline int childLIndex(int i) { return 2 * i + 1; }
	inline int childRIndex(int i) { return 2 * i + 2; }
	// [a,b) query. current k node == [l,r)
	T query(int a, int b, int k, int l, int r) {
		if (r <= a || b <= l) return INIT_VALUE;
		if (a <= l && r <= b) return nodes[k];
		int mid = (l + r) / 2;
		return mergeFunc(query(a, b, childLIndex(k), l, mid), query(a, b, childRIndex(k), mid, r));
	}
public:
	SegmentTree(T iniValue, function<T(T,T)> mergeF) : nodes(NODES_N), INIT_VALUE(iniValue), mergeFunc(mergeF) {
		for (int i = leafIndex(0); i < leafIndex(LEAF_N); i++) {
			nodes[i] = INIT_VALUE;
		}
		for (int i = parentIndex(leafIndex(LEAF_N - 1)); i >= 0; i--) {
			nodes[i] = mergeFunc(nodes[childLIndex(i)], nodes[childRIndex(i)]);
		}
	}
	void update(int valueI, T value) {
		int nodeI = leafIndex(valueI);
		nodes[nodeI] = value;
		while(nodeI > 0) {
			nodeI = parentIndex(nodeI);
			nodes[nodeI] = mergeFunc(nodes[childLIndex(nodeI)], nodes[childRIndex(nodeI)]);
		}
	}
	// [a,b) query
	T query(int a, int b) {
		return query(a, b, 0, 0, LEAF_N);
	}
};

int main() {
	using IntType = int;
	constexpr IntType inf = (1 << 31) - 1;
	constexpr int MAX_ELEM_NUM = 100001;
	SegmentTree<IntType, MAX_ELEM_NUM> s(inf, [](IntType l, IntType r) {return min(l, r); });
	int elemNum, queryNum;
	int com;
	IntType x, y;
	cin >> elemNum >> queryNum;
	for (int qI = 0; qI < queryNum; qI++) {
		cin >> com >> x >> y;
		switch (com) {
		case 0:
			s.update(x, y);
			break;
		case 1:
			IntType ret = s.query(x, y);
			cout << ret << endl;
			break;
		}
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:53:43: warning: integer overflow in expression of type 'int' results in '2147483647' [-Woverflow]
   53 |         constexpr IntType inf = (1 << 31) - 1;
      |                                 ~~~~~~~~~~^~~
a.cc:53:43: error: overflow in constant expression [-fpermissive]
a.cc:53:45: error: overflow in constant expression [-fpermissive]
   53 |         constexpr IntType inf = (1 << 31) - 1;
      |                                             ^
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
#include <limits>
#include <functional>
#include <algorithm>

using namespace std;

template<typename T, int VALUE_N>
class SegmentTree {
	const T INIT_VALUE;
	const function<T(T, T)> mergeFunc;
	const int LEAF_N = 1 << (int)(ceil(log2(VALUE_N)));
	const int NODES_N = LEAF_N * 2 - 1;
	vector<T> nodes;
	inline int leafIndex(int i) { return LEAF_N - 1 + i; }
	inline int parentIndex(int i) { return (i - 1) / 2; }
	inline int childLIndex(int i) { return 2 * i + 1; }
	inline int childRIndex(int i) { return 2 * i + 2; }
	// [a,b) query. current k node == [l,r)
	T query(int a, int b, int k, int l, int r) {
		if (r <= a || b <= l) return INIT_VALUE;
		if (a <= l && r <= b) return nodes[k];
		int mid = (l + r) / 2;
		return mergeFunc(query(a, b, childLIndex(k), l, mid), query(a, b, childRIndex(k), mid, r));
	}
public:
	SegmentTree(T iniValue, function<T(T,T)> mergeF) : nodes(NODES_N), INIT_VALUE(iniValue), mergeFunc(mergeF) {
		for (int i = leafIndex(0); i < leafIndex(LEAF_N); i++) {
			nodes[i] = INIT_VALUE;
		}
		for (int i = parentIndex(leafIndex(LEAF_N - 1)); i >= 0; i--) {
			nodes[i] = mergeFunc(nodes[childLIndex(i)], nodes[childRIndex(i)]);
		}
	}
	void update(int valueI, T value) {
		int nodeI = leafIndex(valueI);
		nodes[nodeI] = value;
		while(nodeI > 0) {
			nodeI = parentIndex(nodeI);
			nodes[nodeI] = mergeFunc(nodes[childLIndex(nodeI)], nodes[childRIndex(nodeI)]);
		}
	}
	// [a,b) query
	T query(int a, int b) {
		return query(a, b, 0, 0, LEAF_N);
	}
};

int main() {
	using IntType = long long;
	constexpr IntType inf = (1 << 31) - 1;
	constexpr int MAX_ELEM_NUM = 100001;
	SegmentTree<IntType, MAX_ELEM_NUM> s(inf, [](IntType l, IntType r) {return min(l, r); });
	int elemNum, queryNum;
	int com;
	IntType x, y;
	cin >> elemNum >> queryNum;
	for (int qI = 0; qI < queryNum; qI++) {
		cin >> com >> x >> y;
		switch (com) {
		case 0:
			s.update(x, y);
			break;
		case 1:
			IntType ret = s.query(x, y);
			cout << ret << endl;
			break;
		}
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:53:43: warning: integer overflow in expression of type 'int' results in '2147483647' [-Woverflow]
   53 |         constexpr IntType inf = (1 << 31) - 1;
      |                                 ~~~~~~~~~~^~~
a.cc:53:43: error: overflow in constant expression [-fpermissive]
a.cc:53:45: error: overflow in constant expression [-fpermissive]
   53 |         constexpr IntType inf = (1 << 31) - 1;
      |                                             ^
Language: C++

#include <vector>
#include <climits>
#include <algorithm>
#include <iomanip>
#include <iostream>
//using namespace std;
 
template <typename T> class Segment_Tree {
private:
    int n; // n = ????´???° ???2*n-1 = ????????°
    std::vector<T> SegTree;
 
public:
    Segment_Tree(int n_) {
	n = 1;
	while( n < n_ )  n *= 2;
	SegTree = std::vector<T>(2*n-1, INT_MAX);
    }
     
    void update(int k, T a) {
	k += n - 1; // ??????index
	SegTree[k] += a; // k?????????????´???? a ?????????
	while( k > 0 ) { // ????????§?????????????????´??°
	    k = (k-1) / 2;
	    SegTree[k] = min(SegTree[2*k+1],SegTree[2*k+2]); // ???
	}
    }
 
    T range_query(int a, int b) { // [a,b)????§£
	return query(a,b,0,0,n);
    }
 
    // [a,b)??????????±???????
    // k:?????????index???l,r:??????k????????????????????????[l,r)
    // ?????£?????????????????????????????¨?????? query(a,b,0,0,n) ??¨??????
    T query(int a, int b, int k, int l, int r) {
	if( r <= a or  b <= l ) return INT_MAX;    // ?????????????????§??????
	if( a <= l and r <= b ) return SegTree[k]; // [a,b)???[l,r)????????¨???????????????????????´???
 
	T vl = query(a,b,k*2+1,l,(l+r)/2);
	T vr = query(a,b,k*2+2,(l+r)/2,r);
	return vl+vr;
    }
 
    void dump() { // ??¨?????¨???
	std::cout << "-------------------------Tree------------------------" << std::endl;
	for(int i=1; i<2*n; i*=2) {
	    for(int j=0; j<i; j++ ) {
		std::cout << std::setw(2) << SegTree[i+j-1];
		for(int w=0; w<(2*(n-1)/i); w++) std::cout << "  ";
	    }
	    std::cout << std::endl;
	}
	std::cout << "-----------------------------------------------------" << std::endl;
    }
};
 
 
 
int main() {

    int n,q;
    cin >> n >> q;
    Segment_Tree<long long > seg(n);

    for(int i=0; i<q; i++) {
	int c,x,y;
	cin >> c >> x >> y;
	if(c==0)
	    seg.update(x,y);
	else
	    std::cout << seg.range_query(x,y+1) << std::endl;

    }
    

    /*
    Segment_Tree<long long > seg(10);
    for(int i=0; i<10; i++)
	seg.update(i,i+1);
    seg.dump();
    for(int i=0; i<10; i++)
	std::cout << seg.range_query(0,i+1) << std::endl;
    */
}

Compiler output:
a.cc: In function 'int main()':
a.cc:63:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   63 |     cin >> n >> q;
      |     ^~~
      |     std::cin
In file included from a.cc:5:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc: In instantiation of 'void Segment_Tree<T>::update(int, T) [with T = long long int]':
a.cc:70:16:   required from here
   70 |             seg.update(x,y);
      |             ~~~~~~~~~~^~~~~
a.cc:25:29: error: 'min' was not declared in this scope; did you mean 'std::min'?
   25 |             SegTree[k] = min(SegTree[2*k+1],SegTree[2*k+2]); // ???
      |                          ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                          std::min
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~