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

#include <iostream>
#include<algorithm>
using namespace std;

const int MAX_N = 131072;

int n;//2????????????
int dat[n];

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

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

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

int main(){

}

Compiler output:
a.cc:8:9: error: size of array 'dat' is not an integral constant-expression
    8 | int dat[n];
      |         ^
a.cc: In function 'int main()':
a.cc:12:53: error: 'INT_MAX' was not declared in this scope
   12 |                 for (int i = 0; i < n; i++)dat[i] = INT_MAX;
      |                                                     ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include<algorithm>
  +++ |+#include <climits>
    3 | using namespace std;
a.cc: In function 'void update(int, int)':
a.cc:21:60: error: expected ')' before ';' token
   21 |                 dat[i] = min(dat[i * 2 + 1], dat[i * 2 + 2];)
      |                             ~                              ^
      |                                                            )
a.cc:21:61: error: expected primary-expression before ')' token
   21 |                 dat[i] = min(dat[i * 2 + 1], dat[i * 2 + 2];)
      |                                                             ^
a.cc: In function 'int query(int, int, int, int, int)':
a.cc:26:37: error: 'INT_MAX' was not declared in this scope
   26 |         if (r <= a || b <= l)return INT_MAX;//???????????????
      |                                     ^~~~~~~
a.cc:26:37: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
a.cc:29:31: error: too few arguments to function 'int query(int, int, int, int, int)'
   29 |                 int vl = query(a, b, k * 2 + 2, (l + r) / 2);
      |                          ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:25:5: note: declared here
   25 | int query(int a, int b,int k, int l, int r){//[a,b)???????°????
      |     ^~~~~
a.cc:30:31: error: too few arguments to function 'int query(int, int, int, int, int)'
   30 |                 int vr = query(a, b, (l + r) / 2, r);
      |                          ~~~~~^~~~~~~~~~~~~~~~~~~~~~
a.cc:25:5: note: declared here
   25 | int query(int a, int b,int k, int l, int r){//[a,b)???????°????
      |     ^~~~~
a.cc: At global scope:
a.cc:35:5: error: redefinition of 'int main()'
   35 | int main(){
      |     ^~~~
a.cc:10:5: note: 'int main()' previously defined here
   10 | int main() {
      |     ^~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <array>
#include <cstdint>
#include <functional>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string>
#include <vector>

#define INF 1000000000
#define MOD 1000000007
#define ll long long
#define rep(i,a,b) for(int i = (a); i < (b); ++i)
#define bitget(a,b) (((a) >> (b)) & 1)
#define vint vector<int>
#define ALL(x) (x).begin(),(x).end()
#define C(x) cout << #x << " : " << x << endl
#define scanf scanf_s

using int32 = int_fast32_t;
using int64 = int_fast64_t;
using uint32 = uint_fast32_t;
using uint64 = uint_fast64_t;

using namespace std;

template<typename Monoid>
class SegTree {
public:
	Monoid* tree;
	size_t size;
	int32 i;
	//?????????????????????
	SegTree(size_t length) {
		--length;
		size = length & 0xffff0000 ? length & 0xffff0000 : length;
		size = size & 0xff00ff00 ? size & 0xff00ff00 : size;
		size = size & 0xf0f0f0f0 ? size & 0xf0f0f0f0 : size;
		size = size & 0xcccccccc ? size & 0xcccccccc : size;
		size = size & 0xaaaaaaaa ? size & 0xaaaaaaaa : size;
		size <<= 1;
		++length;
		tree = (Monoid *)calloc(size << 1, sizeof(Monoid));
	}
	//?????????
	void set() {
		for (i = 0;i > size << 1;++i) tree[i].set();
	}
	//tree[index]???data?????´??°
	void update(size_t index, Monoid &data) {
		index += size;
		tree[index] = data;
		while (index >>= 1) tree[index] = tree[index << 1] + tree[index * 2 + 1];
	}
	//[begin,end)??????????????????
	Monoid range(size_t begin, size_t end) {
		Monoid retL, retR;
		for (begin += size, end += size;begin < end;begin >>= 1, end >>= 1) {
			if (begin & 1) retL = retL + tree[begin++];
			if (end & 1) retR = tree[--end] + retR;
		}
		return retL + retR;
	}
};

struct MIN {
	int32 e;
	MIN() { set(); }
	MIN(int32 x) { e = x; }
	void set() { e = 2000000000; }
	void update(MIN b) { e = b.e; }
	MIN operator+(MIN &other) {
		return e < other.e ? MIN(e) : MIN(other.e);
	};
};

int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	int32 n, q;
	cin >> n >> q;
	int32 c, x, y;
	SegTree<MIN> t(n);
	rep(i, 0, q) {
		cin >> c >> x >> y;
		if (c) {
			printf("%d\n", t.range(x, y + 1).e);
		}
		else {
			t.update(x, MIN(y));
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:94:37: error: cannot bind non-const lvalue reference of type 'MIN&' to an rvalue of type 'MIN'
   94 |                         t.update(x, MIN(y));
      |                                     ^~~~~~
a.cc:54:43: note:   initializing argument 2 of 'void SegTree<Monoid>::update(size_t, Monoid&) [with Monoid = MIN; size_t = long unsigned int]'
   54 |         void update(size_t index, Monoid &data) {
      |                                   ~~~~~~~~^~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=1;i<=n;i++)
#define drep(i,n) for(int i=n;i>=0;i--)
#define INF 100000005
#define MAX 131072
#define ll long long
#define dmp make_pair
#define dpb push_back
#define P pair<int,int>
#define fi first
#define se second
using namespace std;
//__gcd(a,b), __builtin_popcount(a);
const int inf = 2147483647;

int n, dat[2*MAX];
void init(int m){
	n = 1;
	while(n < m)n *= 2;
	for(int i = 0;i < 2*n;i++)dat[i] = inf;
}

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

int query(int a, int b, int k, int l, int r){
	if(b <= l || r <= a)return inf;
	if(a <= l && r <= b)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(){
	printf("%lld", t);
	int m, q, c, x, y;
	scanf("%d%d", &m, &q);
	init(m);
	while(q--){
		scanf("%d%d%d", &c, &x, &y);
		if(!c)change(x, y);
		else printf("%d\n", query(x, y+1, 0, 0, n));
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:24: error: 't' was not declared in this scope; did you mean 'tm'?
   42 |         printf("%lld", t);
      |                        ^
      |                        tm
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int MAX_N 1<<17
int n,dat[2*MAX_N-1];

//INT＿MAXで初期化
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 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=0,int l=0,int r=n){
  if(r<=a||b<=l)return INT_MAX;
  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 main(){
  int q;
  cin>>n>>q;
  init(n);
  for(int i=0;i<q;i++){
    int com,x,y;
    cin>>com>>x>>y;
    if(com)cout<<query(x,y+1)<<endl;
    else update(x,y);
  }
  return 0;
}



Compiler output:
a.cc:3:17: error: expected initializer before numeric constant
    3 | const int MAX_N 1<<17
      |                 ^
a.cc: In function 'void init(int)':
a.cc:8:3: error: 'n' was not declared in this scope; did you mean 'n_'?
    8 |   n=1;
      |   ^
      |   n_
a.cc:10:27: error: 'dat' was not declared in this scope
   10 |   for(int i=0;i<2*n-1;i++)dat[i]=INT_MAX;
      |                           ^~~
a.cc: In function 'void update(int, int)':
a.cc:14:6: error: 'n' was not declared in this scope
   14 |   k+=n-1;
      |      ^
a.cc:15:3: error: 'dat' was not declared in this scope
   15 |   dat[k]=a;
      |   ^~~
a.cc: At global scope:
a.cc:22:45: error: 'n' was not declared in this scope
   22 | int query(int a,int b,int k=0,int l=0,int r=n){
      |                                             ^
a.cc: In function 'int query(int, int, int, int, int)':
a.cc:24:24: error: 'dat' was not declared in this scope
   24 |   if(a<=l&&r<=b)return dat[k];
      |                        ^~~
a.cc: In function 'int main()':
a.cc:34:8: error: 'n' was not declared in this scope
   34 |   cin>>n>>q;
      |        ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int MAX_N 1<<17;
int n,dat[2*MAX_N-1];

//INT＿MAXで初期化
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 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=0,int l=0,int r=n){
  if(r<=a||b<=l)return INT_MAX;
  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 main(){
  int q;
  cin>>n>>q;
  init(n);
  for(int i=0;i<q;i++){
    int com,x,y;
    cin>>com>>x>>y;
    if(com)cout<<query(x,y+1)<<endl;
    else update(x,y);
  }
  return 0;
}



Compiler output:
a.cc:3:17: error: expected initializer before numeric constant
    3 | const int MAX_N 1<<17;
      |                 ^
a.cc:4:13: error: 'MAX_N' was not declared in this scope
    4 | int n,dat[2*MAX_N-1];
      |             ^~~~~
a.cc: In function 'void init(int)':
a.cc:10:27: error: 'dat' was not declared in this scope
   10 |   for(int i=0;i<2*n-1;i++)dat[i]=INT_MAX;
      |                           ^~~
a.cc: In function 'void update(int, int)':
a.cc:15:3: error: 'dat' was not declared in this scope
   15 |   dat[k]=a;
      |   ^~~
a.cc: In function 'int query(int, int, int, int, int)':
a.cc:24:24: error: 'dat' was not declared in this scope
   24 |   if(a<=l&&r<=b)return dat[k];
      |                        ^~~
Language: C++

#include <iostream>

using namespace std;

const int MAX_N = 100000;

int rec(int *a, int s, int t) {

    if (t == s) {
        return a[s];
    }

    return min(rec(a, s, (s + t) / 2), rec(a, (s + t) / 2 + 1, t));
}

int main() {

    int n, q, a[MAX_N], b[MAX_N * 2 - 1];
    cin >> n >> q;

    fill(a, a + MAX_N, INT_MAX);

    //solve
    for (int i = 0; i < q; i++) {
        int com, x, y;
        cin >> com >> x >> y;
        if (com) {
            cout << rec(a, x, y) << endl;
        } else {
            a[x] = y;
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:24: error: 'INT_MAX' was not declared in this scope
   21 |     fill(a, a + MAX_N, 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 |
Language: C++

#include <iostream>
#include <limits>

using namespace std;

const int MAX_N = 100000;

int rec(int *a, int s, int t) {

    if (t == s) {
        return a[s];
    }

    return min(rec(a, s, (s + t) / 2), rec(a, (s + t) / 2 + 1, t));
}

int main() {

    int n, q, a[MAX_N], b[MAX_N * 2 - 1];
    cin >> n >> q;

    fill(a, a + MAX_N, INT_MAX);

    //solve
    for (int i = 0; i < q; i++) {
        int com, x, y;
        cin >> com >> x >> y;
        if (com) {
            cout << rec(a, x, y) << endl;
        } else {
            a[x] = y;
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:24: error: 'INT_MAX' was not declared in this scope
   22 |     fill(a, a + MAX_N, INT_MAX);
      |                        ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include <limits>
  +++ |+#include <climits>
    3 |
Language: C++

#include <bits/stdc++.h>
//#include <math.h>
using namespace std;

#define INF 1.1e9
#define LINF 1.1e18
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define BIT(x,n) bitset<n>(x)
#define PI 3.14159265358979323846

typedef long long ll;
typedef pair<double,double> P;
typedef pair<P,ll> PP;

//-----------------------------------------------------------------------------

struct SegmentTree {
	int n;
	vector<ll> node;

	SegmentTree(int sz) {
		n=1;while(n<sz) n*=2;
		node.resize(n*2-1,(1LL<<31)-1);
	}

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

	ll find(int a,int b,int k=0,int l=0,int r=-1) {
		if(r==-1) r=n;
		if(b<=l||a>=r) return (1LL<<31)-1;
		if(a<=l&&r<=b) return node[k];
		return min(find(a,b,k*2*1,l,(l+r)/2),find(a,b,k*2+2,(l+r)/2,r));
	}
};

int int n,q;

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

	cin>>n>>q;
	SegmentTree seg(n);
	REP(i,q) {
		int type;cin>>type;
		if(type==0) {
			int x;ll y;
			cin>>x>>y;
			seg.update(x,y);
		}
		else {
			int x,y;cin>>x>>y;
			cout<<seg.find(x,y+1)<<endl;
		}
	}

	return 0;
}



Compiler output:
a.cc:49:1: error: two or more data types in declaration of 'n'
   49 | int int n,q;
      | ^~~
a.cc:49:1: error: two or more data types in declaration of 'q'
a.cc: In function 'int main()':
a.cc:55:14: error: 'n' was not declared in this scope; did you mean 'yn'?
   55 |         cin>>n>>q;
      |              ^
      |              yn
a.cc:55:17: error: 'q' was not declared in this scope
   55 |         cin>>n>>q;
      |                 ^
Language: C++

import sys
sys.setrecursionlimit(10000)


def initRMQ(n, D):
    n_ = 1

    while n_ < n:
        n_ *= 2

    for i in range(2*n_ - 1):
        D.append(2147483647)

    return n_


def update(k, a):
    k += n_ - 1
    D[k] = a
    while k > 0:
        k = int((k - 1) / 2)
        D[k] = min(D[k*2 + 1], D[k*2 + 2])


def findMin(a, b):
    return query(a, b + 1, 0, 0, n)


def query(a, b, k, l, r):
    #print('q', a, b, k, l, r)
    if r <= a or b <= l:
        return 2147483647

    if a <= l and r <= b:
        return D[k]

    vl = query(a, b, k*2 + 1, l, int((l + r)/2))
    vr = query(a, b, k*2 + 2, int((l + r)/2), r)

    return min(vl, vr)


if __name__ == '__main__':
    n, q = map(int, input().split())

    D = []
    n_ = initRMQ(n, D)

    for _ in range(q):
        #print(D)
        c, x, y = map(int, input().split())

        if c == 0:
            update(x, y)

        else :
            print(findMin(x, y))



Compiler output:
a.cc:30:6: error: invalid preprocessing directive #print
   30 |     #print('q', a, b, k, l, r)
      |      ^~~~~
a.cc:43:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   43 | if __name__ == '__main__':
      |                ^~~~~~~~~~
a.cc:50:10: error: invalid preprocessing directive #print
   50 |         #print(D)
      |          ^~~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import sys
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include <bits/stdc++.h>
#include <iostream>

using namespace std;
const int INF=pow(2,31)-1;
const int MAX_N=1<<17;
int maxn;
int dat[2*MAX_N-1];
 
int main() {
  int n, q;
  cin >> n >> q;

  maxn=1;
  while (maxn<n) {
    maxn*=2;
  }
  fill(dat,dat+2*maxn-1,INF);

  for (int i=0; i<q; i++) {
    int com, x, y;
    cin >> com >> x >> y;
    if (com==0) {
      update(x,y);
    } else {
      printf("%d\n",find(x,y+1));
    }
  }a
  return 0;
}

void update(int i,int x) {
  i+=maxn-1;
  dat[i]=x;
  while (i>0) {
    i=(i-1)/2;
    dat[i]=min(dat[2*i+1],dat[2*i+2]);
  }
}
int find(int x,int y,int k=0,int l=0,int r=maxn) {
  if (x<=l && r<=y) {
    return dat[k];
  } 
  if (r<=x || y<=l) {
    return INF;
  }
  else {
    int vl=find(x,y,2*k+1,l,(l+r)/2);
    int vr=find(x,y,2*k+2,(l+r)/2,r);
    return min(vl,vr);
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:7: error: 'update' was not declared in this scope
   24 |       update(x,y);
      |       ^~~~~~
a.cc:26:25: error: no matching function for call to 'find(int&, int)'
   26 |       printf("%d\n",find(x,y+1));
      |                     ~~~~^~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:3842:5: note: candidate: 'template<class _IIter, class _Tp> _IIter std::find(_IIter, _IIter, const _Tp&)'
 3842 |     find(_InputIterator __first, _InputIterator __last,
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:3842:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:60:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator> std::find(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
   60 | find(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:60:1: note:   candidate expects 4 arguments, 2 provided
In file included from /usr/include/c++/14/iterator:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT, std::char_traits<_CharT> > >::__type std::find(istreambuf_iterator<_CharT, char_traits<_CharT> >, istreambuf_iterator<_CharT, char_traits<_CharT> >, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   candidate expects 3 arguments, 2 provided
a.cc:28:4: error: 'a' was not declared in this scope
   28 |   }a
      |    ^
Language: C++

#include <bits/stdc++.h>
#include <iostream>

using namespace std;
const int INF=pow(2,31)-1;
const int MAX_N=1<<17;
int maxn;
int dat[2*MAX_N-1];
 
int main() {
  
  int n, q;
  cin >> n >> q;
  maxn=1;
  
  while (maxn<n) {
    maxn*=2;
  }
  fill(dat,dat+2*maxn-1,INF);

  for (int i=0; i<q; i++) {
    int com, x, y;
    cin >> com >> x >> y;
    if (com==0) {
      update(x,y);
    } else {
      printf("%d\n",find(x,y+1));
    }
  }
  return 0;
}

void update(int i,int x) {
  i+=maxn-1;
  dat[i]=x;
  while (i>0) {
    i=(i-1)/2;
    dat[i]=min(dat[2*i+1],dat[2*i+2]);
  }
}
int find(int x,int y,int k=0,int l=0,int r=maxn) {
  if (x<=l && r<=y) {
    return dat[k];
  } 
  if (r<=x || y<=l) {
    return INF;
  }
  else {
    int vl=find(x,y,2*k+1,l,(l+r)/2);
    int vr=find(x,y,2*k+2,(l+r)/2,r);
    return min(vl,vr);
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:7: error: 'update' was not declared in this scope
   25 |       update(x,y);
      |       ^~~~~~
a.cc:27:25: error: no matching function for call to 'find(int&, int)'
   27 |       printf("%d\n",find(x,y+1));
      |                     ~~~~^~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:3842:5: note: candidate: 'template<class _IIter, class _Tp> _IIter std::find(_IIter, _IIter, const _Tp&)'
 3842 |     find(_InputIterator __first, _InputIterator __last,
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:3842:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:60:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator> std::find(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
   60 | find(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:60:1: note:   candidate expects 4 arguments, 2 provided
In file included from /usr/include/c++/14/iterator:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT, std::char_traits<_CharT> > >::__type std::find(istreambuf_iterator<_CharT, char_traits<_CharT> >, istreambuf_iterator<_CharT, char_traits<_CharT> >, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   candidate expects 3 arguments, 2 provided
Language: C++

#include <bits/stdc++.h>
#include <iostream>

using namespace std;
const int INF=pow(2,31)-1;
const int MAX_N=1<<17;
int maxn;
int dat[2*MAX_N-1];
 
int main() {
  int n, q;
  cin >> n >> q;

  maxn=1;
  while (maxn<n) {
    maxn*=2;
  }
  fill(dat,dat+2*maxn-1,INF);

  for (int i=0; i<q; i++) {
    int com, x, y;
    cin >> com >> x >> y;
    if (com==0) {
      update(x,y);
    } else {
      printf("%d\n",find(x,y+1));
    }
  }
  return 0;
}

void update(int i,int x) {
  i+=maxn-1;
  dat[i]=x;
  while (i>0) {
    i=(i-1)/2;
    dat[i]=min(dat[2*i+1],dat[2*i+2]);
  }
}
int find(int x,int y,int k=0,int l=0,int r=maxn) {
  if (x<=l && r<=y) {
    return dat[k];
  } 
  if (r<=x || y<=l) {
    return INF;
  }
  else {
    int vl=find(x,y,2*k+1,l,(l+r)/2);
    int vr=find(x,y,2*k+2,(l+r)/2,r);
    return min(vl,vr);
  }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:24:7: error: 'update' was not declared in this scope
   24 |       update(x,y);
      |       ^~~~~~
a.cc:26:25: error: no matching function for call to 'find(int&, int)'
   26 |       printf("%d\n",find(x,y+1));
      |                     ~~~~^~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:3842:5: note: candidate: 'template<class _IIter, class _Tp> _IIter std::find(_IIter, _IIter, const _Tp&)'
 3842 |     find(_InputIterator __first, _InputIterator __last,
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:3842:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:60:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator> std::find(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
   60 | find(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:60:1: note:   candidate expects 4 arguments, 2 provided
In file included from /usr/include/c++/14/iterator:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT, std::char_traits<_CharT> > >::__type std::find(istreambuf_iterator<_CharT, char_traits<_CharT> >, istreambuf_iterator<_CharT, char_traits<_CharT> >, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   candidate expects 3 arguments, 2 provided
Language: C++

    #include <iostream>
    #include <cstdio>
    #include <vector>
    #include <climits>
    #include <algorithm>
    
    using namespace std;
    

        int n;
        vector<int> dat;
        RMQ(int n_)
        {
            n = 1;
            while (n < n_)
            {
                n *= 2;
            }
            dat.resize(2 * n - 1);
            for (int i = 0; i < 2 * n - 1; ++i)
            {
                dat[i] = INT_MAX;
            }
        }
        void update(int k, int a)
        {
            k += n - 1;
            dat[k] = a;
            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 = 0, int l = 0, int r = 0)
        {
            if (r <= l)
            {
                r = n;
            }
            if (r <= a || b <= l)
            {
                return(INT_MAX);
            }
            if (a <= l && r <= b)
            {
                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;
        RMQ r(n);
        for (int i = 0; i < q; ++i)
        {
            int com, x, y;
            scanf("%d%d%d", &com, &x, &y);
            if (com == 0)
            {
                r.update(x, y);
            }
            else
            {
                printf("%d\n", r.query(x, y + 1));
            }
        }
        return(0);
    }


Compiler output:
a.cc:12:9: error: ISO C++ forbids declaration of 'RMQ' with no type [-fpermissive]
   12 |         RMQ(int n_)
      |         ^~~
a.cc: In function 'int RMQ(int)':
a.cc:24:9: warning: no return statement in function returning non-void [-Wreturn-type]
   24 |         }
      |         ^
a.cc: In function 'int main()':
a.cc:59:12: error: expected ';' before 'r'
   59 |         RMQ r(n);
      |            ^~
      |            ;
a.cc:66:17: error: 'r' was not declared in this scope
   66 |                 r.update(x, y);
      |                 ^
a.cc:70:32: error: 'r' was not declared in this scope
   70 |                 printf("%d\n", r.query(x, y + 1));
      |                                ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
const int MAX_N=10000000;
#define INT_MAX 2147483647
  
int n;
int dat[MAX_N*2-1];

 
int main(){
    int q,a,b,c;
    cin>>n>>q;
     
    int i=n;
    n=1;
 
    while (n<i)n*=2;
     
    fill(dat,dat+n*2,INT_MAX);
     
    while(q--){
        cin>>a>>b>>c;
        if(a)c{
            out<<query(b,c,0,0,n-1)<<endl;
        }
        else update(b,c);     
    }
     
}

void update(int i,int x){
    i+=n-1;
    dat[i]=x;
    while(i>0){
        i=(i-1)/2;
        dat[i]=min(dat[i*2+1],dat[i*2+2]);
    }
}
  
int query(int a,int b,int k,int l,int r){
    if(r<a||b<l)return INT_MAX;
    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+1,r);
        return min(vl,vr);
    }
}


Compiler output:
a.cc:5:9: warning: "INT_MAX" redefined
    5 | #define INT_MAX 2147483647
      |         ^~~~~~~
In file included from /usr/include/c++/14/climits:42,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:38,
                 from a.cc:1:
/usr/lib/gcc/x86_64-linux-gnu/14/include/limits.h:120:9: note: this is the location of the previous definition
  120 | #define INT_MAX __INT_MAX__
      |         ^~~~~~~
a.cc: In function 'int main()':
a.cc:24:15: error: expected ';' before '{' token
   24 |         if(a)c{
      |               ^
      |               ;
a.cc:27:14: error: 'update' was not declared in this scope
   27 |         else update(b,c);
      |              ^~~~~~
Language: C++

#include <iostream>

using namespace std;
int *tree;
int N;

void createTree(int n_){
    int n = 1;
    //int size = pow(2, (log2(N)+1) ) - 1;
    //int h = log2(N) + 1;
    while (n < n_){
        n *= 2;
    }
    N = n;
    tree = new int[2*N-1-1];
    for (int i = 0; i < 2*N-1-1; ++i) {
        tree[i] = INT_MAX;
    }
};
void updateTree(int index, int x){

    index += N -1;
    tree[index] = x;
    while(index > 0){
        index = (index - 1) / 2;
        tree[index] = min(tree[index*2+1],tree[index*2+2]);
    }
};
int query(int a, int b, int k, int l, int r){
    if( r < a || b < l ){
        return INT_MAX;
    }
    if( a <= l && r <= b ){
        return tree[k];
    }
    int vl = query(a, b, k*2+1, l, (l+r)/2);
    int vr = query(a, b, k*2+2, (l+r)/2+1, r);
    return min(vl,vr);
};

int RMQ(int a, int b){
    return query(a, b+1, 0, 0, N);
};

int main() {
    int q; // size of data set and number of queries

    int action, op1, op2; // action 0 - update ;  1 - find

    int cnt = 0;
    cin >> N >> q;
    int ans[q];
    createTree(N);

    int testArr[N];

    for (int i = 0; i < q; ++i) {

        cin >> action >> op1 >> op2;
        if (action == 0){
            updateTree(op1, op2);         
        } else if(action == 1){
            for (int j = 0; j < N; ++j) {
                testArr[j] = tree[j];
            }
            ans[cnt] = RMQ(op1, op2);
            cnt++;
        }

    }
    for (int i = 0; i < cnt; ++i) {
        cout << ans[i] << endl;
    }

    return 0;
}


Compiler output:
a.cc: In function 'void createTree(int)':
a.cc:17:19: error: 'INT_MAX' was not declared in this scope
   17 |         tree[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 | 
a.cc: In function 'int query(int, int, int, int, int)':
a.cc:31:16: error: 'INT_MAX' was not declared in this scope
   31 |         return INT_MAX;
      |                ^~~~~~~
a.cc:31:16: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

#include <iostream>

using namespace std;
int *tree;
int N;

void createTree(int n_){
    int n = 1;
    //int size = pow(2, (log2(N)+1) ) - 1;
    //int h = log2(N) + 1;
    while (n < n_){
        n *= 2;
    }
    N = n;
    tree = new int[2*N-1-1];
    for (int i = 0; i < 2*N-1-1; ++i) {
        tree[i] = INT_MAX;
    }
};
void updateTree(int index, int x){

    index += N -1;
    tree[index] = x;
    while(index > 0){
        index = (index - 1) / 2;
        tree[index] = min(tree[index*2+1],tree[index*2+2]);
    }
};
int query(int a, int b, int k, int l, int r){
    if( r < a || b < l ){
        return INT_MAX;
    }
    if( a <= l && r <= b ){
        return tree[k];
    }
    int vl = query(a, b, k*2+1, l, (l+r)/2);
    int vr = query(a, b, k*2+2, (l+r)/2+1, r);
    return min(vl,vr);
};

int RMQ(int a, int b){
    return query(a, b+1, 0, 0, N);
};

int main() {
    int q; // size of data set and number of queries

    int action, op1, op2; // action 0 - update ;  1 - find

    int cnt = 0;
    cin >> N >> q;
    int ans[q];
    createTree(N);

    int testArr[N];

    for (int i = 0; i < q; ++i) {

        cin >> action >> op1 >> op2;
        if (action == 0){
            updateTree(op1, op2);
        } else if(action == 1){
            for (int j = 0; j < N; ++j) {
                testArr[j] = tree[j];
            }
            ans[cnt] = RMQ(op1, op2);
            cnt++;
        }

    }
    for (int i = 0; i < cnt; ++i) {
        cout << ans[i] << endl;
    }

    return 0;
}


Compiler output:
a.cc: In function 'void createTree(int)':
a.cc:17:19: error: 'INT_MAX' was not declared in this scope
   17 |         tree[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 | 
a.cc: In function 'int query(int, int, int, int, int)':
a.cc:31:16: error: 'INT_MAX' was not declared in this scope
   31 |         return INT_MAX;
      |                ^~~~~~~
a.cc:31:16: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
#include <cstring>
#include <deque>
#include <iomanip>
#include <limits>
#include <fstream>
using namespace std;
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
#define CLR(mat) memset(mat, 0, sizeof(mat))
typedef long long ll;
struct SegmentTree{
  int n_, n = 1;
  int MAX = 2147483647;
  vector<int> v;
  v.resize(202020, MAX);
  SegmentTree(int n_):n_(n_){
    while(n < n_) n *= 2; // 2の冪乗が扱いやすい
  }
  // k番目の要素をaに変更
  void update(int k, int a){
    k += n - 1; // ノード番号にする
    v[k] = a;
    while(k > 0){
      k = (k - 1) / 2;
      v[k] = min(v[2 * k + 1], v[2 * k + 2]);
    }
  }
  // [a, b)の最小値,kはノード番号
  // query(a,b,0,0,n)を呼ぶ
  int query(int a, int b, int k, int l, int r){
    if(b <= l || r <= a) return MAX;
    if(a <= l && r <= b) return v[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()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, q;
  cin>>n>>q;
  SegmentTree seg(n);
  FOR(i,0,q){
      int com;
      int x, y;
      cin>>com>>x>>y;
      if(com == 0){
          seg.update(x, y);
      } else {
          cout<<seg.query(x, y + 1, 0, 0, n)<<endl;
      }
  }
  return 0;
}


Compiler output:
a.cc:28:3: error: 'v' does not name a type
   28 |   v.resize(202020, MAX);
      |   ^
Language: C++

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
#include <cstring>
#include <deque>
#include <iomanip>
#include <limits>
#include <fstream>
using namespace std;
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
#define CLR(mat) memset(mat, 0, sizeof(mat))
typedef long long ll;
struct SegmentTree{
  int n_, n = 1;
  int MAX = 2147483647;
  vector<int> v(202020, MAX);
  SegmentTree(int n_):n_(n_){
    while(n < n_) n *= 2; // 2の冪乗が扱いやすい
  }
  // k番目の要素をaに変更
  void update(int k, int a){
    k += n - 1; // ノード番号にする
    v[k] = a;
    while(k > 0){
      k = (k - 1) / 2;
      v[k] = min(v[2 * k + 1], v[2 * k + 2]);
    }
  }
  // [a, b)の最小値,kはノード番号
  // query(a,b,0,0,n)を呼ぶ
  int query(int a, int b, int k, int l, int r){
    if(b <= l || r <= a) return MAX;
    if(a <= l && r <= b) return v[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()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, q;
  cin>>n>>q;
  SegmentTree seg(n);
  FOR(i,0,q){
      int com;
      int x, y;
      cin>>com>>x>>y;
      if(com == 0){
          seg.update(x, y);
      } else {
          cout<<seg.query(x, y + 1, 0, 0, n)<<endl;
      }
  }
  return 0;
}


Compiler output:
a.cc:27:17: error: expected identifier before numeric constant
   27 |   vector<int> v(202020, MAX);
      |                 ^~~~~~
a.cc:27:17: error: expected ',' or '...' before numeric constant
a.cc: In member function 'void SegmentTree::update(int, int)':
a.cc:34:6: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   34 |     v[k] = a;
      |      ^
a.cc:37:8: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   37 |       v[k] = min(v[2 * k + 1], v[2 * k + 2]);
      |        ^
a.cc:37:19: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   37 |       v[k] = min(v[2 * k + 1], v[2 * k + 2]);
      |                   ^
a.cc:37:33: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   37 |       v[k] = min(v[2 * k + 1], v[2 * k + 2]);
      |                                 ^
a.cc: In member function 'int SegmentTree::query(int, int, int, int, int)':
a.cc:44:34: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   44 |     if(a <= l && r <= b) return v[k];
      |                                  ^
Language: C++

#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

#define int long long

#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define REPS(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (b); i <= i##_len; ++i)
#define REV(i, a, b) for (int i = (a); i >= (b); --i)
#define CLR(a, b) memset((a), (b), sizeof(a))
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define INF (3e15)

using namespace std;

struct SegmentTree {
    int n;
    vector<int> dat;

    SegmentTree(int _n) {
        n = 2;
        while (n < _n) n *= 2;
        dat.resize(n);

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

    void update(int k, int a) {
        k += n;
        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 (r <= a || b <= l) return INT_MAX;

        if (a <= l && r <= b) {
            return dat[k];
        } else {
            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 N, Q;

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    cin >> N >> Q;
    SegmentTree seg(N);

    while (Q--) {
        int com, x, y;
        cin >> com >> x >> y;
        if (com == 0) {
            seg.update(x, y);
        } else {
            cout << seg.query(x, y + 1, 0, 0, N) << endl;
        }
    }

    return 0;
}



Compiler output:
a.cc: In constructor 'SegmentTree::SegmentTree(long long int)':
a.cc:44:54: error: 'INT_MAX' was not declared in this scope
   44 |         for (int i = 0; i < 2 * n - 1; ++i) dat[i] = INT_MAX;
      |                                                      ^~~~~~~
a.cc:21:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   20 | #include <utility>
  +++ |+#include <climits>
   21 | #include <vector>
a.cc: In member function 'long long int SegmentTree::query(long long int, long long int, long long int, long long int, long long int)':
a.cc:57:38: error: 'INT_MAX' was not declared in this scope
   57 |         if (r <= a || b <= l) return INT_MAX;
      |                                      ^~~~~~~
a.cc:57:38: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

#define int long long

#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define REPS(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (b); i <= i##_len; ++i)
#define REV(i, a, b) for (int i = (a); i >= (b); --i)
#define CLR(a, b) memset((a), (b), sizeof(a))
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define INF (3e15)

using namespace std;

struct SegmentTree {
    int n;
    vector<int> dat;

    SegmentTree(int _n) {
        n = 2;
        while (n < _n) n *= 2;
        dat.resize(n);

        for (int i = 0; i < 2 * n - 1; ++i) dat[i] = 2147483647;
    }

    void update(int k, int a) {
        k += n;
        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 (r <= a || b <= l) return INT_MAX;

        if (a <= l && r <= b) {
            return dat[k];
        } else {
            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 N, Q;

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    cin >> N >> Q;
    SegmentTree seg(N);

    while (Q--) {
        int com, x, y;
        cin >> com >> x >> y;
        if (com == 0) {
            seg.update(x, y);
        } else {
            cout << seg.query(x, y + 1, 0, 0, N) << endl;
        }
    }

    return 0;
}



Compiler output:
a.cc: In member function 'long long int SegmentTree::query(long long int, long long int, long long int, long long int, long long int)':
a.cc:57:38: error: 'INT_MAX' was not declared in this scope
   57 |         if (r <= a || b <= l) return INT_MAX;
      |                                      ^~~~~~~
a.cc:21:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   20 | #include <utility>
  +++ |+#include <climits>
   21 | #include <vector>
Language: C++

#include<vector>
#include<iostream>
#include<algorithm>
using namespace std;
#define INF INT_MAX
class segment_tree {
private:
	int n;
	vector<int> node;
public:
	//元配列をセグメント木で表現する
	segment_tree(vector<int>v) {
		
		int sz = v.size();
		//最下段のノード数は元配列のサイズ以上になる最小の2冪->これをnとおく
		n = 1;
		while (n < sz) {
			n *= 2;
		}
		node.resize(2 * n - 1, INF);
		//最下段を初期化
		for (int i = 0; i < sz; i++) {
			node[i + n - 1] = v[i];
		}
		//親の値を決めていく
		for (int i = n - 2; i >= 0; i++) {
			node[i] = min(node[2 * i + 1], node[2 * i + 2]);
		}
	}

	void update(int x, int val) {
		x += (n - 1);
		node[x] = val;
		while (x > 0) {
			x = (x - 1) / 2;
			node[x] = min(node[2 * x + 1], node[2 * x + 2]);
		}
	}
	//[a,b)の最小値を求める
	//k番目のノード　範囲は[l,r)
	int query(int a, int b, int k=0, int l=0, int r=-1) {
		if (r < 0) {
			r = n;
		}
		if (r <= a || b <= l)
		{
			return INF;
		}
		if (a <= l && r <= b)
		{
			return node[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 main() {
	int N;
	int Q;
	cin >> N >> Q;
	segment_tree seg(vector<int>(N, INF));
	for (int i = 0; i < Q; i++) {
		int c, x, y;
		cin >> c >> x >> y;
		if (c == 0) {
			seg.update(x, y);
		}
		else {
			cout << seg.query(x, y + 1) << endl;
		}
	}
}








Compiler output:
a.cc: In constructor 'segment_tree::segment_tree(std::vector<int>)':
a.cc:5:13: error: 'INT_MAX' was not declared in this scope
    5 | #define INF INT_MAX
      |             ^~~~~~~
a.cc:20:40: note: in expansion of macro 'INF'
   20 |                 node.resize(2 * n - 1, INF);
      |                                        ^~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include<algorithm>
  +++ |+#include <climits>
    4 | using namespace std;
a.cc: In member function 'int segment_tree::query(int, int, int, int, int)':
a.cc:5:13: error: 'INT_MAX' was not declared in this scope
    5 | #define INF INT_MAX
      |             ^~~~~~~
a.cc:47:32: note: in expansion of macro 'INF'
   47 |                         return INF;
      |                                ^~~
a.cc:5:13: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    5 | #define INF INT_MAX
      |             ^~~~~~~
a.cc:47:32: note: in expansion of macro 'INF'
   47 |                         return INF;
      |                                ^~~
a.cc: In function 'int main()':
a.cc:5:13: error: 'INT_MAX' was not declared in this scope
    5 | #define INF INT_MAX
      |             ^~~~~~~
a.cc:67:41: note: in expansion of macro 'INF'
   67 |         segment_tree seg(vector<int>(N, INF));
      |                                         ^~~
a.cc:5:13: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    5 | #define INF INT_MAX
      |             ^~~~~~~
a.cc:67:41: note: in expansion of macro 'INF'
   67 |         segment_tree seg(vector<int>(N, INF));
      |                                         ^~~
Language: C++

#include<vector>
#include<iostream>
#include<algorithm>
using namespace std;
const int INF = INT_MAX;
class segment_tree {
private:
	int n;
	vector<int> node;
public:
	//元配列をセグメント木で表現する
	segment_tree(vector<int>v) {
		
		int sz = v.size();
		//最下段のノード数は元配列のサイズ以上になる最小の2冪->これをnとおく
		n = 1;
		while (n < sz) {
			n *= 2;
		}
		node.resize(2 * n - 1, INF);
		//最下段を初期化
		for (int i = 0; i < sz; i++) {
			node[i + n - 1] = v[i];
		}
		//親の値を決めていく
		for (int i = n - 2; i >= 0; i++) {
			node[i] = min(node[2 * i + 1], node[2 * i + 2]);
		}
	}

	void update(int x, int val) {
		x += (n - 1);
		node[x] = val;
		while (x > 0) {
			x = (x - 1) / 2;
			node[x] = min(node[2 * x + 1], node[2 * x + 2]);
		}
	}
	//[a,b)の最小値を求める
	//k番目のノード　範囲は[l,r)
	int query(int a, int b, int k=0, int l=0, int r=-1) {
		if (r < 0) {
			r = n;
		}
		if (r <= a || b <= l)
		{
			return INF;
		}
		if (a <= l && r <= b)
		{
			return node[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 main() {
	int N;
	int Q;
	cin >> N >> Q;
	segment_tree seg(vector<int>(N, INF));
	for (int i = 0; i < Q; i++) {
		int c, x, y;
		cin >> c >> x >> y;
		if (c == 0) {
			seg.update(x, y);
		}
		else {
			cout << seg.query(x, y + 1) << endl;
		}
	}
}








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

#include<vector>
#include<iostream>
#include<algorithm>
using namespace std;
 int const INF = INT_MAX;
class segment_tree {
private:
	int n;
	vector<int> node;
public:
	//元配列をセグメント木で表現する
	segment_tree(vector<int>v) {
		
		int sz = v.size();
		//最下段のノード数は元配列のサイズ以上になる最小の2冪->これをnとおく
		n = 1;
		while (n < sz) {
			n *= 2;
		}
		node.resize(2 * n - 1, INF);
		//最下段を初期化
		for (int i = 0; i < sz; i++) {
			node[i + n - 1] = v[i];
		}
		//親の値を決めていく
		for (int i = n - 2; i >= 0; i++) {
			node[i] = min(node[2 * i + 1], node[2 * i + 2]);
		}
	}

	void update(int x, int val) {
		x += (n - 1);
		node[x] = val;
		while (x > 0) {
			x = (x - 1) / 2;
			node[x] = min(node[2 * x + 1], node[2 * x + 2]);
		}
	}
	//[a,b)の最小値を求める
	//k番目のノード　範囲は[l,r)
	int query(int a, int b, int k=0, int l=0, int r=-1) {
		if (r < 0) {
			r = n;
		}
		if (r <= a || b <= l)
		{
			return INF;
		}
		if (a <= l && r <= b)
		{
			return node[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 main() {
	int N;
	int Q;
	cin >> N >> Q;
	segment_tree seg(vector<int>(N, INF));
	for (int i = 0; i < Q; i++) {
		int c, x, y;
		cin >> c >> x >> y;
		if (c == 0) {
			seg.update(x, y);
		}
		else {
			cout << seg.query(x, y + 1) << endl;
		}
	}
}








Compiler output:
a.cc:5:18: error: 'INT_MAX' was not declared in this scope
    5 |  int const INF = INT_MAX;
      |                  ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include<algorithm>
  +++ |+#include <climits>
    4 | using namespace std;