criyle/codenet-compile-errors huggingface dataset:
Language: Java

mport java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

class Main {
	public static void main (String[] args) throws java.lang.Exception{
		int n=0;
		int sum=1;
		ArrayList<Integer> h = new ArrayList<Integer>();

		Scanner scan = new Scanner(System.in);
		n=scan.nextInt();

		for(int i=0; i<n; i++) h.add(scan.nextInt());

		Collections.sort(h);
		Collections.reverse(h);

		for(int i=0; i<n; i++) sum += Math.max((h.get(i) - i/4), 0);

		System.out.println(sum);
	}
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.util.ArrayList;
^
Main.java:2: error: class, interface, enum, or record expected
import java.util.Collections;
^
Main.java:3: error: class, interface, enum, or record expected
import java.util.Scanner;
^
3 errors
Language: Java

mport java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

class Main {
	public static void main (String[] args) throws java.lang.Exception{
		int n=0;
		long sum=1;
		ArrayList<Integer> h = new ArrayList<Integer>();

		Scanner scan = new Scanner(System.in);
		n=scan.nextInt();

		for(int i=0; i<n; i++) h.add(scan.nextInt());

		Collections.sort(h);
		Collections.reverse(h);

		for(int i=0; i<n; i++) sum += Math.max((h.get(i) - i/4), 0);

		System.out.println(sum);
	}
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.util.ArrayList;
^
Main.java:2: error: class, interface, enum, or record expected
import java.util.Collections;
^
Main.java:3: error: class, interface, enum, or record expected
import java.util.Scanner;
^
3 errors
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<map>
#include<algorithm>
#include<functional>
#define all(c) c.begin(),c.end()
#define uni(c) c.erase(unique(c.begin(),c.end()),c.end())
#define pb push_back
using namespace std;
typedef long long int ll;
int main(){
	int n;
	while(cin>>n){
		vector<ll> x(n);
		for(int i=0;i<n;i++)
			cin>>x[i];
		ll ans=1;
		sort(all(x),greater<ll>());
		ll ms=0;
		for(int i=0;i<n;i++){
			if(i&&i%4==0){
				ms++;
			}
			ans+=max(0,x[i]-ms);
		}
		
		cout<<ans<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:33: error: no matching function for call to 'max(int, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type)'
   25 |                         ans+=max(0,x[i]-ms);
      |                              ~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/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:   template argument deduction/substitution failed:
a.cc:25:33: note:   deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'})
   25 |                         ans+=max(0,x[i]-ms);
      |                              ~~~^~~~~~~~~~~
/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, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:5:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:25:33: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   25 |                         ans+=max(0,x[i]-ms);
      |                              ~~~^~~~~~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
  int n,i,j;
  cin >> n;
  vector<int> v(n);
  for(i=0; i<n; i++){
    cin >> v[i];
  }
  sort(v.rbegin(),v.rend());
  long long r = 1;
  for(i=0;i<n&&(j=a[i]-i/4)>0;i++)r+=j;
  cout << r << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:19: error: 'a' was not declared in this scope
   15 |   for(i=0;i<n&&(j=a[i]-i/4)>0;i++)r+=j;
      |                   ^
Language: Java

import java.math.*;
import java.util.*;

public class AOJ_Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
	
		int n = sc.nextInt();
		BigInteger bi = BigInteger.ONE;
		for(int i=2;i<=n+1;i++) bi = bi.multiply(BigInteger.valueOf(i));
		System.out.println(bi.add(BigInteger.valueOf(2)));
		for(int i=2;i<=n+1;i++) System.out.println(i);
	}
}

Compiler output:
Main.java:4: error: class AOJ_Main is public, should be declared in a file named AOJ_Main.java
public class AOJ_Main {
       ^
1 error
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<map>
#include<algorithm>
#include<functional>
#define all(c) c.begin(),c.end()
#define uni(c) c.erase(unique(c.begin(),c.end()),c.end())
#define pb push_back
using namespace std;
typedef __int64 ll;
string sum(string a,string b){
	string s;
	int n=max(a.size(),b.size());
	while(a.size()!=n){
		a="0"+a;
	}
	while(b.size()!=n){
		b="0"+b;
	}
	reverse(all(a));
	reverse(all(b));
	int p=0;
	for(int i=0;i<n;i++){
		int x=(a[i]-'0')+(b[i]-'0')+p;
		p=0;
		if(x>=10)
			p=1;
		s=(char)('0'+x%10)+s;
	}
	if(p){
		s='1'+s;
	}
	return s;
}
string mult(string a,string b){
	string s="0";
	reverse(all(a));
	reverse(all(b));
	string pz="";
	for(int i=0;i<b.size();i++){
		int p=0;
		string t="";
		for(int j=0;j<a.size();j++){
			int x=(a[j]-'0')*(b[i]-'0')+p;
			p=x/10;
			t=(char)(x%10+'0')+t;
		}
		if(p){
			t=(char)(p%10+'0')+t;
		}
		s=sum(s,t+pz);
	}
	
	
	return s;
}
string tost(int x){
	string s="";
	while(x){
		s=(char)(x%10+'0')+s;
		x/=10;
	}
	return s;
}
int main(){
	ll n;
	while(cin>>n){
		string mul="1";
		for(ll i=0;i<n+1;i++){
			mul=mult(mul,tost(i+1));
		}
		cout<<sum(mul,tost(2))<<endl;
		for(int i=0;i<n;i++){
			cout<<i+2<<endl;
		}
	}
	
}

Compiler output:
a.cc:11:9: error: '__int64' does not name a type; did you mean '__int64_t'?
   11 | typedef __int64 ll;
      |         ^~~~~~~
      |         __int64_t
a.cc: In function 'int main()':
a.cc:67:9: error: 'll' was not declared in this scope; did you mean 'all'?
   67 |         ll n;
      |         ^~
      |         all
a.cc:68:20: error: 'n' was not declared in this scope
   68 |         while(cin>>n){
      |                    ^
a.cc:70:23: error: expected ';' before 'i'
   70 |                 for(ll i=0;i<n+1;i++){
      |                       ^~
      |                       ;
a.cc:70:28: error: 'i' was not declared in this scope
   70 |                 for(ll i=0;i<n+1;i++){
      |                            ^
Language: C++

import java.math.*;
import java.io.*;


class Main
{
    
    public static void main(String args[])throws IOException
    {
	BigInteger a = new BigInteger("1");
	for(int i=2;i<=1501;i++)
	    a = a.multiply(new BigInteger(Integer.toString(i)));
	BufferedReader in = new BufferedReader(new InputStreamReader(System.in));   
	a = a.add(new BigInteger("1501"));
	int n = Integer.parseInt(in.readLine());
	System.out.println(a);
	for(int i=1501;i<n+1501;i++)
	    System.out.println(i);

    }

}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.math.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.io.*;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:8:11: error: expected ':' before 'static'
    8 |     public static void main(String args[])throws IOException
      |           ^~~~~~~
      |           :
a.cc:8:29: error: 'String' has not been declared
    8 |     public static void main(String args[])throws IOException
      |                             ^~~~~~
a.cc:8:42: error: expected ';' at end of member declaration
    8 |     public static void main(String args[])throws IOException
      |                                          ^
      |                                           ;
a.cc:8:43: error: 'throws' does not name a type
    8 |     public static void main(String args[])throws IOException
      |                                           ^~~~~~
a.cc:22:2: error: expected ';' after class definition
   22 | }
      |  ^
      |  ;
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <vector>

using namespace std;

typedef long long lli;

const int DIGITS = 1000;
const int BASE = 100000;
const int BD = 8;

class BigNum{
  lli val[DIGITS], tmp[DIGITS];
  int dig;
public:
  BigNum(){
    dig = 1;
    memset(val, 0, sizeof(val));
  }
  BigNum(lli x){
    dig = 0;
    for(int i=0;i<DIGITS;++i){
      if(x == 0) val[i] = 0;
      else{
        ++dig;
        val[i] = x % BASE;
        x /= BASE;
      }
    }
  }

  void operator + (const lli x){
    val[0] += x;
    for(int i=0;i<DIGITS;++i){
      val[i+1] += val[i] / BASE;
      val[i] %= BASE;
      if(val[i]) dig = i + 1;
    }
  }

  void operator * (const lli x){
    for(int i=0;i<DIGITS;++i) val[i] *= x;
    for(int i=0;i<DIGITS;++i){
      val[i+1] += val[i] / BASE;
      val[i] %= BASE;
      if(val[i]) dig = i + 1;
    }
  }

  void print(){
    vector<char> t;
    for(int i=0;i<dig;++i){
      for(int j=0;j<BD;++j){
        t.push_back(val[i]%10 + '0');
        val[i] /= 10;
      }
    }
    while(t.back() == '0') t.pop_back();
    reverse(t.begin(), t.end());
    for(int i=0;i<t.size();++i) cout << t[i];
    cout << endl;
  }
};

main(){
  int n;
  cin >> n;
  BigNum x = BigNum(1);
  for(int i=2;i<=n+1;++i) x * i;
  x + 2;
  x.print();
  for(int i=0;i<n;i++) cout << i+2 << endl;
}

Compiler output:
a.cc: In constructor 'BigNum::BigNum()':
a.cc:20:5: error: 'memset' was not declared in this scope
   20 |     memset(val, 0, sizeof(val));
      |     ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <vector>
  +++ |+#include <cstring>
    5 | 
a.cc: At global scope:
a.cc:67:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   67 | main(){
      | ^~~~
Language: C++

#!/bin/ruby
require 'prime'
prm=Prime.instance.each.first(1500)
lcm=2
start=2
ncmp=1
x=1
factors=[2]
while ncmp<1500
  start+=lcm
  if (start+ncmp)%prm[x]==0 then
    ncmp+=1
    factors<< prm[x]
    lcm*=prm[x]
    x+=1
    while true
      f=false
      (0...x).each do |e|
        if (start+ncmp)%prm[e]==0 then
          f=true
          factors<< prm[e]
          ncmp+=1
          break
        end
      end
      break if f
    end
  end
end
n=gets.to_i
puts start,factors[0...n]

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #!
    1 | #!/bin/ruby
      |  ^
a.cc:2:9: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes
    2 | require 'prime'
      |         ^~~~~~~
a.cc:18:8: error: too many decimal points in number
   18 |       (0...x).each do |e|
      |        ^~~~~
a.cc:31:20: error: too many decimal points in number
   31 | puts start,factors[0...n]
      |                    ^~~~~
a.cc:2:1: error: 'require' does not name a type
    2 | require 'prime'
      | ^~~~~~~
Language: C++

#include<iostream>
#include<sstream>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<complex>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cassert>
using namespace std;

#define rep(i,n) for(int i=0;i<(int)n;i++)
#define each(i,c) for(__typeof(c.begin()) i=c.begin();i!=c.end();i++)
#define pb push_back
#define mp make_pair
#define all(c) c.begin(),c.end()
#define dbg(x) cerr<<__LINE__<<": "<<#x<<" = "<<(x)<<endl

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;
const int inf=(int)1e9;
const double EPS=1e-9, INF=1e12;

const int mod = (int)1e8 + 7;
int h, w, pw[11];
char in[12][12];
int dp[2][3][60000];

int main(){
	pw[0] = 1;
	rep(i, 10) pw[i + 1] = pw[i] * 3;
	
	cin >> h >> w;
	rep(i, h) cin >> in[i];
	
	int cur = 0, next = 1;
	dp[0][0][0] = 1;
	
	rep(i, h){
		memset(dp[next], 0, sizeof(dp[next]));
		rep(j, w){
			rep(l, 3) rep(u, pw[w]) if(dp[cur][l][u]){
				
				int tu = u / pw[j] % 3;
				
				if(in[i][j] == '.'){
					if(tu && l) continue;
					if(l == 0 || j < w - 1) (dp[next][l][u] += dp[cur][l][u]) %= mod;
					continue;
				}
				int rest = in[i][j] - '0' - tu - l;
				rep(nl, 3){
					int nu = rest - nl;
					if(nu < 0 || nu > 2) continue;
					if(nl == 0 || j < w - 1)
						(dp[next][nl][u + pw[j] * (nu - tu)] += dp[cur][j][l][u]) %= mod;
				}
			}
		}
	}
	cout << dp[cur][0][0] << endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:59:102: error: invalid types 'int[int]' for array subscript
   59 |                                                 (dp[next][nl][u + pw[j] * (nu - tu)] += dp[cur][j][l][u]) %= mod;
      |                                                                                                      ^
Language: C++

#include <iostream>
#include <vector>
#include <string>

#define FOR(i, a, b) for(int i = (a); i < (int)(b); ++i)
#define rep(i, n) FOR(i, 0, n)
#define MEMSET(v, s) memset(v, s, sizeof(v))

using namespace std;

vector<string> v;
const int MOD = 1e8 + 7;
int dp[10][10][60000][3];
int R, C;
int thr[11];

inline int get(int x, int pos){
	return x / thr[pos] % 3;
}

inline int ins(int x, int pos, int val){
	return x + (val - get(x, pos))*thr[pos];
}

int rec(int r, int c, int x, int left){
	if (r == R) return !x;
	if (c == C) return left?0:rec(r + 1, 0, x, 0);

	int &res = dp[r][c][x][left];
	if (res >= 0) return res;

	res = 0;
	if (v[r][c] == '.'){
		if (!(get(x, c) && left)) res = rec(r, c + 1, x, left);
	}
	else{
		int rest = v[r][c] - '0';
		rest -= get(x, c) + left;
		rep(right, 3){
			rep(down, 3){
				if (right + down != rest) continue;
				res += rec(r, c + 1, ins(x, c, down), right);
				res %= MOD;
			}
		}
	}

	return res;
}

int main(){
	thr[0] = 1;
	FOR(i, 1, 11){
		thr[i] = thr[i - 1] * 3;
	}

	cin >> R >> C;
	v.resize(R);
	rep(i, R) cin >> v[i];

	MEMSET(dp, -1);
	cout << rec(0, 0, 0, 0) << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:22: error: 'memset' was not declared in this scope
    7 | #define MEMSET(v, s) memset(v, s, sizeof(v))
      |                      ^~~~~~
a.cc:61:9: note: in expansion of macro 'MEMSET'
   61 |         MEMSET(dp, -1);
      |         ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <vector>
  +++ |+#include <cstring>
    3 | #include <string>
Language: C++

#include<cstdio>
#include<cstdlib>
#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<string>
#include<cmath>
//#include<>
using namespace std;

typedef pair<int,int> pii;
typedef pair<int,int> Node;
typedef long long ll;
#define rep(i,j) for(i=0;i<j;i++)
#define rev_rep(i,j) for(i=j;i>=0;i&#8212;-)

int INF=1<<30;
class Dijkstra
{
public:
  typedef struct Edge{int to,cost;}Edge;
  vector< vector<Edge> > Graph;//接続リスト

  Dijkstra(int n)
  {
    vector<Edge> temp;
    Graph.resize(n,temp);
  }

  void add_arc(int x,int y,int c)
  {
    Edge e={y,c};
    Graph[x].push_back(e);
  }

  vector<int> get_distance(int s)
  {
    priority_queue< Node ,vector<Node>,greater<Node> > que;//(sからの距離,インデックス)
    vector<int>ans;
    int i;
    ans.resize(Graph.size(),INF);
    ans[s]=0;
    que.push(Node(0,s));
    while(!que.empty()){
      Node now=que.top();que.pop();
      int now_i=now.second;
      //nowへの最小距離でないならスキップ
      if(ans[now_i]<now.first)continue;
      //nowからの辺全てをみる
      rep(i,Graph[now_i].size()){
	Edge e=Graph[now_i][i];
	//nowから行った方が近かったら更新
	if(ans[e.to]>ans[now_i]+e.cost){
	  ans[e.to]=ans[now_i]+e.cost;
	  que.push(Node(ans[e.to],e.to));
	}
      }
    }
    return ans;
  }

};

bool comp_second_greater(const pii& a,const pii& b)
{
  if(a.second!=b.second)
    return a.second>b.second;
  else
    return a.first>b.first;
}

int solve(vector<pii> distance,int fs,int fe)
{
  vector<pii>::iterator fs_ok,fe_ok;
  fs_ok=upper_bound(distance.begin(),distance.end(),pii(fs,INF));
  if(fs_ok==distance.begin())return 0;
  sort(distance.begin(),fs_ok,comp_second_greater);
  fe_ok=upper_bound(distance.begin(),fs_ok,pii(-1,fe),comp_second_greater);
  return (int)(fe_ok-distance.begin());
}

int main()
{
  int n,m;
  cin>>n>>m;
  Dijkstra map(n);
  int i;
  rep(i,m)
    {
      int a,b,c;
      cin>>a>>b>>c;
      map.add_arc(a,b,c);
      map.add_arc(b,a,c);
    }
  
  vector<int> start_to=map.get_distance(0),end_to=map.get_distance(n-1);
  vector<pii> distance;
  rep(i,n)
      distance.push_back(pii(start_to[i],end_to[i]));

  sort(distance.begin(),distance.end());

  int q;
  cin>>q;

  rep(i,q)
    {
      int fs,fe;
      cin>>fs>>fe;
      cout<<solve(distance,fs,fe)<<endl;
    }
  
  return 0;
}

Compiler output:
a.cc:17:20: error: '#' is not followed by a macro parameter
   17 | #define rev_rep(i,j) for(i=j;i>=0;i&#8212;-)
      |                    ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

typedef long long W;

const W INF = 1LL << 50;

struct edge {
	int to;
	W cost;
};
typedef pair<W, int> P;
typedef vector<vector <edge > > Graph;

vector<W> dijkstra(int s, const Graph& G) {
	vector<W> d(G.size());
	priority_queue< P, vector<P>, greater<P> > que;
	fill(d.begin(), d.end(), INF);
	d[s] = 0;
	que.push(P(0, s));
	while(!que.empty()) {
		P p = que.top();
		que.pop();
		int v = p.second;
		if(d[v] < p.first) continue;
		for(int i = 0; i < G[v].size(); i++) {
			edge e = G[v][i];
			if(d[e.to] > d[v] + e.cost) {
				d[e.to] = d[v] + e.cost;
				que.push(P(d[e.to], e.to));
			}
		}
	}
	return d;
}

template <class T>
struct BIT {
	int n;
	vector<T> x;
	BIT(int n_ = 0) : n(n_), x(n + 1, 0) {}
	int size() const { return n; }
	T sum(int r) const {
		T S = 0;
		for(r = r - 1; r >= 0; r = (r & (r + 1)) - 1) S += x[r];
		return S;
	}
	T sum(int l, int r) const { return sum(r) - sum(l); }
	void add(int k, const T &a) {
		for(; k < n; k |= k + 1) x[k] += a;
	}
	void set(int k, const T &a) { add(k, a - sum(k, k + 1)); }
	int lower_bound(T x) {
		int ng = -1, ok = n_ - 1;
		while(abs(ng - ok) > 1) {
			int mid = (ng + ok) / 2;
			if(b.sum(0, mid + 1) >= x) ok = mid;
			else ng = mid;
		}
		return ok;
	}
};

struct Q {
	ll fs, fg;
	int id;
	bool operator <(const Q& x) const {
		return fs < x.fs;
	}
};

typedef pair<ll, ll> Pll;

int ans[100000];

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

	int n, m;
	cin >> n >> m;

	Graph G(n);
	for(int i = 0; i < m; i++) {
		int a, b, c;
		cin >> a >> b >> c;
		G[a].push_back({ b, c });
		G[b].push_back({ a, c });
	}

	vector<W> ds = dijkstra(0, G);
	vector<W> dg = dijkstra(n - 1, G);
	vector<Pll> dd(n);
	map<W, int> dg_map;
	for(int i = 0; i < dg.size(); i++) {
		dg_map[dg[i]] = -1;
		dd[i] = { ds[i], dg[i] };
	}
	sort(dd.begin(), dd.end());
	int cnt = 0;
	for(auto v : dg_map) {
		dg_map[v.first] = cnt++;
	}

	int qn;
	cin >> qn;
	vector<Q> qs(qn);
	for(int i = 0; i < qn; i++) {
		cin >> qs[i].fs >> qs[i].fg;
		qs[i].id = i;
	}
	sort(qs.begin(), qs.end());

	BIT<ll> b(cnt);
	int di = 0;
	for(auto q : qs) {
		while(di < n && dd[di].first <= q.fs) {
			int idx = dg_map[dd[di].second];
			b.add(idx, 1);
			di++;
		}
		auto it = dg_map.lower_bound(q.fg);
		if(it == dg_map.end()) continue;
		ans[q.id] = b.sum(it->second, cnt);
	}

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

Compiler output:
a.cc: In member function 'int BIT<T>::lower_bound(T)':
a.cc:55:35: error: 'n_' was not declared in this scope; did you mean 'n'?
   55 |                 int ng = -1, ok = n_ - 1;
      |                                   ^~
      |                                   n
a.cc:58:28: error: 'b' was not declared in this scope
   58 |                         if(b.sum(0, mid + 1) >= x) ok = mid;
      |                            ^
Language: C++

#include <cstdio>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
typedef long long ll;
typedef pair<ll,int> P;
#define pu push
#define pb push_back
#define mp make_pair
#define INF 10000000000000000
int n,m;
ll start[100005];
ll goal[100005];
ll d[100005];
pair<ll,ll> qwe[100005];
struct edge{
	int to; ll cost;
	edge(int a,int b):to(a),cost(b){}
};
vector<edge>vec[100005];
void dijkstra1(int s){
	priority_queue<P,vector<P>,greater<P> > que;
	que.pu(mp(0,s));
	fill(d,d+n,INF);
	d[s]=0;
	while(!que.empty()){
		P p=que.top(); que.pop();
		int V=p.second;
		if(d[V]<p.first) continue;
		for(int i=0;i<vec[V].size();i++){
			edge e=vec[V][i];
			if(d[e.to] > d[V]+e.cost){
				d[e.to]=d[V]+e.cost;
				que.push(mp(d[e.to],e.to));
			}
		}
	}
}
vector<ll>seg[1<<18];
ll limits,limite;
void update1(vector<ll> x,int a){
	seg[a+(1<<17)-1]=x;
}
void update(){
		for(int i=(1<<17)-2;i>=0;i--){
		seg[i].resize(seg[i*2+1].size()+seg[i*2+2].size());
		merge(seg[i*2+1].begin(),seg[i*2+1].end(),seg[i*2+2].begin(),seg[i*2+2].end(),seg[i].begin());
		}
}
int sum(int a,int b,int k,int l,int r){
	if(l>b || a>r){
		return 0;
	}else if(a<=l && r<=b){
		int rp=lower_bound(seg[k].begin(),seg[k].end(),limite)-seg[k].begin();
		return seg[k].size()-rp; 
	}else{
		return sum(a,b,k*2+1,l,(l+r)/2)+sum(a,b,k*2+2,(l+r)/2+1,r);
	}
}
int main(){
	scanf("%d %d",&n,&m);
	for(int i=0;i<m;i++){
		int a,b;
		ll c;
		scanf("%d %d %lld",&a,&b,&c);
		vec[a].pb(edge(b,c)); vec[b].pb(edge(a,c));
	}
	dijkstra(0);
	for(int i=0;i<n;i++){
		start[i]=d[i];
	}
	dijkstra(n-1);
	for(int i=0;i<n;i++){
		goal[i]=d[i];
		qwe[i]=mp(start[i],goal[i]);
	}
	sort(qwe,qwe+n);
	for(int i=0;i<n;i++){
		vector<ll>er; er.pb(qwe[i].second);
		update1(er,i); start[i]=qwe[i].first;
	}
	update();
	int Q;
	scanf("%d",&Q);
	for(int i=0;i<Q;i++){
		scanf("%lld %lld",&limits,&limite);
		int eo=upper_bound(start,start+n,limits)-start;
		printf("%d\n",sum(0,eo-1,0,0,(1<<17)-1));
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:69:9: error: 'dijkstra' was not declared in this scope; did you mean 'dijkstra1'?
   69 |         dijkstra(0);
      |         ^~~~~~~~
      |         dijkstra1
Language: C++

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

class UnionFind {
    vector<int> p, r, a;
    int find(int i) {
        return i == p[i] ? i : (p[i] = find(p[i]));
    }
public:
    UnionFind(int n) : p(n), r(n), a(n, 1) {
        for (int i = 0; i < n; ++i)
            p[i] = i;
    }
    bool same(int i, int j) {
        return find(i) == find(j);
    }
    void unite(int i, int j) {
        i = find(i);
        j = find(j);
        if (r[i] < r[j]) {
            p[i] = j;
        } else {
            p[j] = i;
            r[i] += i != j && r[i] == r[j];
        }
        if (i != j)
            a[p[i]] = a[i] + a[j];
    }
    int number(int i) {
        return a[find(i)];
    }
};

int main() {
    int n;
    cin >> n;
    vector<pair<int, pair<int, int>>> a(n - 1);
    for (auto& p : a)
        cin >> p.second.first >> p.second.second >> p.first;
    sort(a.begin(), a.end());
    UnionFind uf(n);
    long long sm = 0;
    for (auto& p : a) {
        auto& q = p.second;
        sm += long long(p.first) * uf.number(q.first) * uf.number(q.second);
        uf.unite(q.first, q.second);
    }
    cout << sm << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:15: error: expected primary-expression before 'long'
   47 |         sm += long long(p.first) * uf.number(q.first) * uf.number(q.second);
      |               ^~~~
Language: C

/*
AizuOnline A1508
Title:RMQ
13/02/05 TE
*/
#include <stdio.h>
// Select Below
#include <stdlib.h>
//#include <string.h>
//#include <float.h>
//#include <math.h>
#include <limits.h>
//Global data section
int a[200000],n,q;
int x[200000];
int y[200000];
int z[200000];
//
void min_val(int l,int r)
{
  int i,minval;
  minval=INT_MAX;
  for(i=l;i<=r;i++)
    if(minval > a[i])
      minval=a[i];

  printf("%d\n",minval);
}
void rotate(int l,int r)
{
  
  
  int i,wk;
  wk = a[r];
  //for(i=r-1;i>=l;i--)
  //  a[i+1]=a[i];
  memmove(a+r,(r-l)+sizeof(int),a+r-1,(r-l)+sizeof(int));
  a[l]=wk;
  
}
void print()
{
  int i;

  for(i=0;i<n;i++)
    printf("%d:",a[i]);
    printf("\n");
}
void update(int pos,int val)
{
  a[pos]=val;
}
void eval_query(int x,int y,int z)
{
  if(x == 0)
    rotate(y,z);
  else if(x == 1)
    min_val(y,z);
  else if(x==2)
    update(y,z);
  //  print();
}
main()
{
  int i;

  scanf("%d %d",&n,&q);
  for(i=0;i<n;i++)
    scanf("%d",&(a[i]));
  for(i=0;i<q;i++)
    scanf("%d %d %d",&(x[i]),&(y[i]),&(z[i]));

  for(i=0;i<q;i++)
    eval_query(x[i],y[i],z[i]);

return(0);
}

Compiler output:
main.c: In function 'rotate':
main.c:37:3: error: implicit declaration of function 'memmove' [-Wimplicit-function-declaration]
   37 |   memmove(a+r,(r-l)+sizeof(int),a+r-1,(r-l)+sizeof(int));
      |   ^~~~~~~
main.c:13:1: note: include '<string.h>' or provide a declaration of 'memmove'
   12 | #include <limits.h>
  +++ |+#include <string.h>
   13 | //Global data section
main.c:37:3: warning: incompatible implicit declaration of built-in function 'memmove' [-Wbuiltin-declaration-mismatch]
   37 |   memmove(a+r,(r-l)+sizeof(int),a+r-1,(r-l)+sizeof(int));
      |   ^~~~~~~
main.c:37:3: note: include '<string.h>' or provide a declaration of 'memmove'
main.c:37:20: error: passing argument 2 of 'memmove' makes pointer from integer without a cast [-Wint-conversion]
   37 |   memmove(a+r,(r-l)+sizeof(int),a+r-1,(r-l)+sizeof(int));
      |               ~~~~~^~~~~~~~~~~~
      |                    |
      |                    long unsigned int
main.c:37:20: note: expected 'const void *' but argument is of type 'long unsigned int'
main.c:37:36: error: passing argument 3 of 'memmove' makes integer from pointer without a cast [-Wint-conversion]
   37 |   memmove(a+r,(r-l)+sizeof(int),a+r-1,(r-l)+sizeof(int));
      |                                 ~~~^~
      |                                    |
      |                                    int *
main.c:37:36: note: expected 'long unsigned int' but argument is of type 'int *'
main.c:37:3: error: too many arguments to function 'memmove'
   37 |   memmove(a+r,(r-l)+sizeof(int),a+r-1,(r-l)+sizeof(int));
      |   ^~~~~~~
main.c: At top level:
main.c:63:1: error: return type defaults to 'int' [-Wimplicit-int]
   63 | main()
      | ^~~~
Language: C

#include <stdio.h>
#include <stdlib.h>

	int number,queue,queueparam,num1,num2;
	int *numberset;
	int i,j;

int query(int numberset[],int queueparam,int num1,int num2){}

int problem1508(){
	scanf("%d %d",number,queue);
	numberset=(int *)malloc(sizeof(int)*number);
	for(i=0;i<number;i++){
	scanf("%d",numberset[i]);
	}
	for(i=0;i<queue;i++){
	scanf("%d %d %d",queueparam,num1,num2);
	query(numberset,queueparam,num1,num2);
	}
	free(numberset);
	return 0;
}

int query(int numberset[],int queueparam,int num1,int num2){
	int temp;
	int min_number;
	for(i=0;i<queue;i++){
		temp=0; min_number=0;
		switch(queueparam){
		case 0:
			temp=numberset[num2];
		for(j=num1;j<num2;j++){
			numberset[j+1]=numberset[j];
		}
			numberset[num1]=temp;
		break;
		case 1:
		min_number=numberset[num1];
		for(j=num1;j<num2;j++){
			if(min_number>numberset[j]){min_number=numberset[j];}
		}
		printf("%d\n",min_number);
		break;
		case 2:
		temp=numberset[num1];
		numberset[num1]=numberset[num2];
		numberset[num2]=temp;
		break;
		}
	}
}

Compiler output:
main.c:24:5: error: redefinition of 'query'
   24 | int query(int numberset[],int queueparam,int num1,int num2){
      |     ^~~~~
main.c:8:5: note: previous definition of 'query' with type 'int(int *, int,  int,  int)'
    8 | int query(int numberset[],int queueparam,int num1,int num2){}
      |     ^~~~~
Language: C

#include<stdio.h>
#include<stdlib.h>
#define min(a,b)(a)<(b)?(a):(b)
#define  MAX_N (1<<29)
int N;
int num[MAX_N];
int tree[2*MAX_N-1];

void init(int _n)
{
	int i;
	for(N=1;N<=_n;N*=2);
	for(i=0;i<2*N-1;i++)
		tree[i]=10000005;
}

void update(int p,int a)
{
	p+=N-1;
	tree[p]=a;
	while(p>0)
	{
		p=(p-1)/2;
		tree[p]=min(tree[2*p+1],tree[2*p+2]);
	}
}

void shift(int l,int r)
{
	int i,t;
	t=tree[r+N-1];
	for(i=r-1;i>=l;i--)
		update(i+1,tree[i+N-1]);
	update(l,t);
}


int query(int a,int b,int k,int l,int r)
{
	if(r<=a||b<=l)
		return 10000005;
	if(a<=l&&r<=b)
		return tree[k];
	else
	{
		int t1=query(a,b,2*k+1,l,(l+r)/2);
		int t2=query(a,b,2*k+2,(l+r)/2,r);
		return min(t1,t2);
	}
}

int main()
{
	int n,i,t,q,x,y,z;
	scanf("%d%d",&n,&q);
	init(n);
	for(i=0;i<n;scanf("%d",&t),update(i++,t));
	for(;q--;)
	{
		scanf("%d%d%d",&x,&y,&z);
		switch(x)
		{
		case 0:shift(y,z);break;
		case 1:printf("%d\n",query(y,z+1,0,0,N));break;
		case 2:update(y,z);break;
		}
	}
	return 0;
}

Compiler output:
/tmp/cccz80x3.o: in function `init':
main.c:(.text+0x45): relocation truncated to fit: R_X86_64_PC32 against symbol `tree' defined in .bss section in /tmp/cccz80x3.o
/tmp/cccz80x3.o: in function `update':
main.c:(.text+0x8e): relocation truncated to fit: R_X86_64_PC32 against symbol `tree' defined in .bss section in /tmp/cccz80x3.o
main.c:(.text+0xc1): relocation truncated to fit: R_X86_64_PC32 against symbol `tree' defined in .bss section in /tmp/cccz80x3.o
main.c:(.text+0xdd): relocation truncated to fit: R_X86_64_PC32 against symbol `tree' defined in .bss section in /tmp/cccz80x3.o
main.c:(.text+0xfa): relocation truncated to fit: R_X86_64_PC32 against symbol `tree' defined in .bss section in /tmp/cccz80x3.o
/tmp/cccz80x3.o: in function `shift':
main.c:(.text+0x134): relocation truncated to fit: R_X86_64_PC32 against symbol `tree' defined in .bss section in /tmp/cccz80x3.o
main.c:(.text+0x164): relocation truncated to fit: R_X86_64_PC32 against symbol `tree' defined in .bss section in /tmp/cccz80x3.o
/tmp/cccz80x3.o: in function `query':
main.c:(.text+0x1ea): relocation truncated to fit: R_X86_64_PC32 against symbol `tree' defined in .bss section in /tmp/cccz80x3.o
collect2: error: ld returned 1 exit status
Language: C++

#include "../../template/tmpl.cpp"

//insert - erase
template<typename T> struct TreapRMQ{
public:
	struct Node{
		T v;int p;// 値,優先度
		int sz,mv;//部分木のサイズ,最小値
		Node *l,*r;// l,r
		Node(T v,int p):v(v),p(p),sz(1),mv(v){
			l=r=NULL;
		}
	};

	unsigned size(){return size(root);}
	unsigned size(Node* t){return !t?0:t->sz;}
	T mv(Node* t){return !t?INF<T>():t->mv;}

	Node* root;
	TreapRMQ():root(NULL){};

	Node* update(Node* t){
		t->sz=size(t->l)+size(t->r)+1;
		t->mv=min(min(mv(t->l),mv(t->r)),t->v);
		return t;
	}

	Node* merge(Node* l,Node* r){
		if(!l || !r)return l?l:r;
		
		if(l->p > r->p){
			l->r = merge(l->r,r);
			return update(l);
		}else{
			r->l = merge(l,r->l);
			return update(r);
		}
	}

	pair<Node*,Node*> split(Node* t,unsigned k){//[0,k) [k,n)
		if(!t)return make_pair((Node*)NULL,(Node*)NULL);
		if(k<=size(t->l)){
			auto s=split(t->l,k);
			t->l=s.second;
			return make_pair(s.first,update(t));
		}else{
			auto s=split(t->r,k - (size(t->l)+1));
			t->r=s.first;
			return make_pair(update(t),s.second);
		}
	}

	Node* insert(unsigned k,T v){return root=insert(root,k,v,rand());}
	Node* insert(Node* t,unsigned k,T v,int p){
		pair<Node*,Node*> s=split(t,k);
		t=merge(s.first,new Node(v,p));
		t=merge(t,s.second);
		return update(t);
	}

	Node* erase(unsigned k){return root=erase(root,k);}
	Node* erase(Node* t,unsigned k){
		pair<Node*,Node*> sr=split(t,k+1),sl=split(sr.first,k);	
		t = merge(sl.first,sr.second);
		return update(t);
	}

	Node* find(unsigned k){
		Node* v=root;
		while(v){
			unsigned cl=size(v->l);
			if(k==cl)return v;
			else if(k<cl) v=v->l;
			else {
				v=v->r;
				k -= cl+1;
			}
		}
		return v;
	}

  	// Node *find(Node *t, int k){
   //      int c = count(t->lch);
   //      if(k <  c) return find(t->lch, k);
   //      if(k == c) return t;
   //      return find(t->rch, k - c - 1);
   //  }
   //  Node *find(int k){ return find(root, k); }
    

	Node* shift(unsigned l,unsigned r){
		pair<Node*,Node*> s1,s2,s3;
		s3=split(root,r);s2=split(s3.first,r-1);s1=split(s2.first,l);
		return root=update(merge(merge(merge(s1.first,s2.second),s1.second),s3.second));
	}

	T query(int l,int r){return query(l,r,root);}

	T query(int l,int r,Node* t){
		int sz=size(t);
		if(sz<=l || r<=0)return INF<T>();
		if(l<=0 && sz<=r)return mv(t);

		int c=size(t->l);
		T res=min(query(l,r,t->l),query(l-c-1,r-c-1,t->r));
		if(l<=c && c < r)res=min(res,t->v);
		return res;
	}
};

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n,q;
	TreapRMQ<int> t;

	cin >> n >> q;
	REP(i,n){
		int a;cin >> a;t.insert(i,a);
	}

	while(q--){
		int x,y,z;cin >> x >> y >> z;
		if(x==2){
			t.erase(y);t.insert(y,z);
		}else if(x==1){

			cout << t.query(y,z+1)<<endl;
		}else{
			t.shift(y,z+1);
		}
	}
}

Compiler output:
a.cc:1:10: fatal error: ../../template/tmpl.cpp: No such file or directory
    1 | #include "../../template/tmpl.cpp"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <string>
#include <vector>

#define REP(i,n) for(int i=0;i<(n);++i)

using namespace std;

typedef int Data;

const int INF = 1e8;

struct RBST {
  Data value;
  RBST *left;
  RBST *right;
  int cnt;
  Data minv;
  RBST(Data v)
    : value(v), left(nullptr), right(nullptr),
    cnt(1), sum(v) {}
};

int count(RBST *t) { return !t ? 0 : t->cnt; }
Data minv(RBST *t) { return !t ? INF : t->minv; }
RBST *update(RBST *t) {
  t->cnt = count(t->left) + count(t->right) + 1;
  t->minv = min(min(minv(t->left), minv(t->right)), t->value);
  return t;
}

RBST *merge(RBST *l, RBST *r) {
  if (!l || !r) return !l ? r : l;

  int cnt_sum = count(l) + count(r);
  // rand()?????¨?°????????????????????????????????£?????????£??????????????¨??????????????§???mt19937??¨????????????????£??????????
  if ((my_rand() % cnt_sum) < count(l)) {
    l->right = merge(l->right, r);
    return update(l);
  } else {
    r->left = merge(l, r->left);
    return update(r);
  }
}

pair<RBST*, RBST*> split(RBST *t, int k) {
  if (!t) return make_pair(nullptr, nullptr);
  
  if (k <= count(t->left)) {
    auto s = split(t->left, k);
    t->left = s.second;
    return make_pair(s.first, update(t));
  } else {
    auto s = split(t->right, k - count(t->left) - 1);
    t->right = s.first;
    return make_pair(update(t), s.second);
  }
}

RBST *insert(RBST *t, int k, Data v) {
  auto s = split(t, k);
  return merge(s.first, merge(new RBST(v), s.second));
}

RBST *erase(RBST *t, int k) {
  auto s1 = split(t, k);
  auto s2 = split(s1.second, 1);
  delete s2.first;
  return merge(s1.first, s2.second);
}

int main() {
  srand(0);
  RBST *root = nullptr;
  int n,q;
  cin>>n>>q;
  REP(i,n){
    int a;
    cin>>a;
    root = insert(root, i, a);
  }
  REP(i,q){
    int x,y,z;
    cin>>x>>y>>z;
    switch(x){
      case 0: {
        auto b = split(root, z+1);
        auto f = split(b.first, y);
        auto s = split(f.second, z-y);
        RBST *ns = merge(s.second, s.first);
        RBST *nf = merge(f.first, ns);
        root = merge(nf, b.second);
      } break;
      case 1: {
        auto b = split(root, z+1);
        auto f = split(b.first, y);
        cout << f.second->minv << endl;
        RBST *nf = merge(f.first, f.second);
        root = merge(nf, b.second);
      } break;
      case 2: {
        root = erase(root, y);
        root = insert(root, y, z);
      } break;
    }
  }
  return 0;
}

Compiler output:
a.cc: In constructor 'RBST::RBST(Data)':
a.cc:21:13: error: class 'RBST' does not have any field named 'sum'
   21 |     cnt(1), sum(v) {}
      |             ^~~
a.cc: In function 'RBST* merge(RBST*, RBST*)':
a.cc:37:8: error: 'my_rand' was not declared in this scope; did you mean 'srand'?
   37 |   if ((my_rand() % cnt_sum) < count(l)) {
      |        ^~~~~~~
      |        srand
a.cc:35:35: warning: control reaches end of non-void function [-Wreturn-type]
   35 |   int cnt_sum = count(l) + count(r);
      |                                   ^
Language: C++

#include <iostream>
#include <string>
#include <vector>

#define REP(i,n) for(int i=0;i<(n);++i)

using namespace std;

typedef int Data;

const int INF = 1e8;

struct RBST {
  Data value;
  RBST *left;
  RBST *right;
  int cnt;
  Data minv;
  RBST(Data v)
    : value(v), left(nullptr), right(nullptr),
    cnt(1), minv(v) {}
};

int count(RBST *t) { return !t ? 0 : t->cnt; }
Data minv(RBST *t) { return !t ? INF : t->minv; }
RBST *update(RBST *t) {
  t->cnt = count(t->left) + count(t->right) + 1;
  t->minv = min(min(minv(t->left), minv(t->right)), t->value);
  return t;
}

RBST *merge(RBST *l, RBST *r) {
  if (!l || !r) return !l ? r : l;

  int cnt_sum = count(l) + count(r);
  // rand()?????¨?°????????????????????????????????£?????????£??????????????¨??????????????§???mt19937??¨????????????????£??????????
  if ((my_rand() % cnt_sum) < count(l)) {
    l->right = merge(l->right, r);
    return update(l);
  } else {
    r->left = merge(l, r->left);
    return update(r);
  }
}

pair<RBST*, RBST*> split(RBST *t, int k) {
  if (!t) return make_pair(nullptr, nullptr);
  
  if (k <= count(t->left)) {
    auto s = split(t->left, k);
    t->left = s.second;
    return make_pair(s.first, update(t));
  } else {
    auto s = split(t->right, k - count(t->left) - 1);
    t->right = s.first;
    return make_pair(update(t), s.second);
  }
}

RBST *insert(RBST *t, int k, Data v) {
  auto s = split(t, k);
  return merge(s.first, merge(new RBST(v), s.second));
}

RBST *erase(RBST *t, int k) {
  auto s1 = split(t, k);
  auto s2 = split(s1.second, 1);
  delete s2.first;
  return merge(s1.first, s2.second);
}

int main() {
  srand(0);
  RBST *root = nullptr;
  int n,q;
  cin>>n>>q;
  REP(i,n){
    int a;
    cin>>a;
    root = insert(root, i, a);
  }
  REP(i,q){
    int x,y,z;
    cin>>x>>y>>z;
    switch(x){
      case 0: {
        auto b = split(root, z+1);
        auto f = split(b.first, y);
        auto s = split(f.second, z-y);
        RBST *ns = merge(s.second, s.first);
        RBST *nf = merge(f.first, ns);
        root = merge(nf, b.second);
      } break;
      case 1: {
        auto b = split(root, z+1);
        auto f = split(b.first, y);
        cout << f.second->minv << endl;
        RBST *nf = merge(f.first, f.second);
        root = merge(nf, b.second);
      } break;
      case 2: {
        root = erase(root, y);
        root = insert(root, y, z);
      } break;
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'RBST* merge(RBST*, RBST*)':
a.cc:37:8: error: 'my_rand' was not declared in this scope; did you mean 'srand'?
   37 |   if ((my_rand() % cnt_sum) < count(l)) {
      |        ^~~~~~~
      |        srand
a.cc:35:35: warning: control reaches end of non-void function [-Wreturn-type]
   35 |   int cnt_sum = count(l) + count(r);
      |                                   ^
Language: C++

#include "avlarray.hpp"

struct Info {
  Info(int min_) : min(min_) {}
  int min;
};
Info mergeInfo(Info x, Info y) {
  return Info(std::min(x.min, y.min));
}
void dumpInfo(Info x) {
  fprintf(stderr, "[min=%d]", x.min);
}

int main() {
  AVLArray<Info> root;
  int n, q;
  scanf("%d %d", &n, &q);
  for(int i = 0; i < n; ++i) {
    int a;
    scanf("%d", &a);
    root = merge(root, newNode(Info(a)));
  }
  // dumpArray(root);
  for(int i = 0; i < q; ++i) {
    int x, y, z;
    scanf("%d %d %d", &x, &y, &z);
    if( x == 0 ) {
      auto x1t = split(root, y);
      auto x2t = split(x1t.second, z - y);
      auto x3x4 = split(x2t.second, 1);
      root = merge(merge(x1t.first, x3x4.first), merge(x2t.first, x3x4.second));
    }
    if( x == 1 ) {
      auto x1t = split(root, y);
      auto x2x3 = split(x1t.second, z - y + 1);
      fprintf(stderr, "%d\n", x2x3.first->val.min);
    }
    if( x == 2 ) {
      auto x1t = split(root, y);
      auto x2x3 = split(x1t.second, 1);
      root = merge(merge(x1t.first, newNode(Info(z))), x2x3.second);
    }
    // dumpArray(root);
    // fprintf(stderr, "\n");
    // dumpTree(root);
    // fprintf(stderr, "\n");
  }
  
  return 0;
}

Compiler output:
a.cc:1:10: fatal error: avlarray.hpp: No such file or directory
    1 | #include "avlarray.hpp"
      |          ^~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <climits>
#include <iostream>
#include <queue>
#include <cmath>
#define REP(i,n) for(int i=0; i<(int)(n); i++)

#include <set>
#include <cstdio>
inline int getInt(){ int s; scanf("%d", &s); return s

using namespace std;

int main(){
  const int n = getInt();
  const int q = getInt();

  int c = min(2000000 / 500, (int)(n / floor(sqrt(n)
  int m = n / c + (n % c == 0 ? 0 : 1);

  if(m > 500){
    m = 500;
    c = n / m;
    if(n % c != 0) m++;
  }

  vector<deque<int> > v(m);
  vector<multiset<int> > s(m);

  REP(i,n){
    const int a = getInt();
    v[i / c].push_back(a);
    s[i / c].insert(a);
  }

  REP(qq, q){
    const int x = getInt();
    const int y = getInt();
    const int z = getInt();

    if(x == 1){
      const int lIdx = y / c;
      const int rIdx = z / c;

      int ans = INT_MAX;
      if(lIdx == rIdx){
        for(int i = y % c; i <= z % c; i++)
          ans = min(ans, v[lIdx][i]);
      }else{
        for(int i = y % c; i < c; i++)
          ans = min(ans, v[lIdx][i]);

        for(int i = 0; i <= z % c; i++)
          ans = min(ans, v[rIdx][i]);

        for(int i = lIdx + 1; i < rIdx; i++)
          ans = min(ans, *s[i].begin());
      }

      printf("%d\n", ans);
    }else if(x == 0){
      const int lIdx = y / c;
      const int rIdx = z / c;

      const int rmemo = v[rIdx][z % c];

      v[rIdx].erase(v[rIdx].begin() + z % c);
      s[rIdx].erase(s[rIdx].find(rmemo));

      for(int i = rIdx; i > lIdx; i--){
        v[i].push_front(v[i - 1][c - 1]);
        s[i].insert(v[i - 1][c - 1]);

        s[i - 1].erase(s[i - 1].find(v[i - 1][c - 1])
        v[i - 1].pop_back();
      }

      v[lIdx].insert(v[lIdx].begin() + y % c, rmemo);
      s[lIdx].insert(rmemo);

      // REP(i,n) printf("%d ", v[i / c][i % c]); put
    }else{
      const int original = v[y / c][y % c];
      v[y / c][y % c] = z;
      s[y / c].erase(s[y / c].find(original));
      s[y / c].insert(z);
    }
  }

  return 0;
}

Compiler output:
a.cc: In function 'int getInt()':
a.cc:9:54: error: expected ';' before 'using'
    9 | inline int getInt(){ int s; scanf("%d", &s); return s
      |                                                      ^
      |                                                      ;
   10 | 
   11 | using namespace std;
      | ~~~~~                                                 
a.cc:13:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   13 | int main(){
      |         ^~
a.cc:13:9: note: remove parentheses to default-initialize a variable
   13 | int main(){
      |         ^~
      |         --
a.cc:13:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:13:11: error: a function-definition is not allowed here before '{' token
   13 | int main(){
      |           ^
a.cc:90:2: error: expected '}' at end of input
   90 | }
      |  ^
a.cc:9:20: note: to match this '{'
    9 | inline int getInt(){ int s; scanf("%d", &s); return s
      |                    ^
Language: C++

/*
AizuOnline A1508
Title:RMQ
13/02/05 TE
*/
#include <stdio.h>
// Select Below
#include <stdlib.h>
//#include <string.h>
//#include <float.h>
//#include <math.h>
#include <limits.h>
//Global data section
int a[200000],n,q;
int x[200000];
int y[200000];
int z[200000];
//
void min_val(int l,int r)
{
  int i,minval;
  minval=INT_MAX;
  for(i=l;i<=r;i++)
    if(minval > a[i])
      minval=a[i];

  printf("%d\n",minval);
}
void rotate(int l,int r)
{
  
  
  int i,wk;
  wk = a[r];
  //for(i=r-1;i>=l;i--)
  //  a[i+1]=a[i];
  memmove(a+r,(r-l)+sizeof(int),a+r-1,(r-l)+sizeof(int));
  a[l]=wk;
  
}
void print()
{
  int i;

  for(i=0;i<n;i++)
    printf("%d:",a[i]);
    printf("\n");
}
void update(int pos,int val)
{
  a[pos]=val;
}
void eval_query(int x,int y,int z)
{
  if(x == 0)
    rotate(y,z);
  else if(x == 1)
    min_val(y,z);
  else if(x==2)
    update(y,z);
  //  print();
}
main()
{
  int i;

  scanf("%d %d",&n,&q);
  for(i=0;i<n;i++)
    scanf("%d",&(a[i]));
  for(i=0;i<q;i++)
    scanf("%d %d %d",&(x[i]),&(y[i]),&(z[i]));

  for(i=0;i<q;i++)
    eval_query(x[i],y[i],z[i]);

return(0);
}

Compiler output:
a.cc: In function 'void rotate(int, int)':
a.cc:37:3: error: 'memmove' was not declared in this scope
   37 |   memmove(a+r,(r-l)+sizeof(int),a+r-1,(r-l)+sizeof(int));
      |   ^~~~~~~
a.cc:13:1: note: 'memmove' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   12 | #include <limits.h>
  +++ |+#include <cstring>
   13 | //Global data section
a.cc: At global scope:
a.cc:63:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   63 | main()
      | ^~~~
Language: C++

import java.util.*;

class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		while(true) {
			int a, b, c, d, e;
			a = sc.nextInt();
			b = sc.nextInt();
			c = sc.nextInt();
			d = sc.nextInt();
			e = sc.nextInt();
			if(a+b+c+d+e==0)
				break;
			int na, nb, nc;
			na = sc.nextInt();
			nb = sc.nextInt();
			nc = sc.nextInt();

			int res;
			res = e * d * (nc / d) + Math.min(c * (nc % d), e * d) + nb * b + na * a;
			if(nc % d != 0) {
				int tmp = 0;
				if(d - nc % d <= nb) {
					res = Math.min(res, e * d * (nc / d + 1) + (nb - (d - nc % d)) * b + na * a);
				}
				else if(d - nc % d <= nb + na) {
					res = Math.min(res, e * d * (nc / d + 1) + (na - (d - nc % d - nb)) * a);
				}

			}
			System.out.println(res);
		}
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:15: error: expected ':' before 'static'
    4 |         public static void main(String args[]) {
      |               ^~~~~~~
      |               :
a.cc:4:33: error: 'String' has not been declared
    4 |         public static void main(String args[]) {
      |                                 ^~~~~~
a.cc:35:2: error: expected ';' after class definition
   35 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:5:17: error: 'Scanner' was not declared in this scope
    5 |                 Scanner sc = new Scanner(System.in);
      |                 ^~~~~~~
a.cc:8:29: error: 'sc' was not declared in this scope; did you mean 'c'?
    8 |                         a = sc.nextInt();
      |                             ^~
      |                             c
a.cc:21:50: error: 'Math' was not declared in this scope
   21 |                         res = e * d * (nc / d) + Math.min(c * (nc % d), e * d) + nb * b + na * a;
      |                                                  ^~~~
a.cc:32:25: error: 'System' was not declared in this scope
   32 |                         System.out.println(res);
      |                         ^~~~~~
Language: C++

70 100 340 4 200
1 1 4
70 100 340 4 200
0 1 3
70 100 340 4 200
1 1 2
0 0 0 0 0

Compiler output:
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 70 100 340 4 200
      | ^~