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

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

void SimSelSort(int num[ ], int n,int K);


int main(void){
  int N;
  int K;
  int a[10000] = {};
  int i=0; 
  int b;

  while(i<10000){
    a[i] = rand()%9+1;
    ++i;
  }
  
  printf("N select number");
  scanf("%d",&N);

  printf("K select number");
  scanf("%d",&K); scanf("%d",&N);

  scanf("%d",&S);

  for(i;i<N;i++){

   scanf("%d",&b);
   a[i]=b;
  }
 
  SimSelSort(a,N,K);
  
  

}

void SimSelSort(int num[ ], int n,int K)
{
  int i, j, k, min, temp;
  int time=0;
  int sum=0;
  int kazu=1;

    for (i = 0; i < n - 1; i++) {
        min = num[i];                
        k = i;                       
        for (j = i + 1; j < n; j++) {
            if (num[j] < min) {      
                min = num[j];        
                k = j;                
            }
        }                             
        temp = num[i];                
        num[i] = num[k];
        num[k] = temp;
    }
    for(time; time<n;++time){
      if(num[time]==kazu){
	kazu++;
      }
     
      if(kazu==K){
      printf("%d\n",K);
      break;      
      } 
    }   
   
    if(kazu<K){
      printf("0\n");       
    }   

}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:12: error: 'rand' was not declared in this scope
   15 |     a[i] = rand()%9+1;
      |            ^~~~
a.cc:25:15: error: 'S' was not declared in this scope
   25 |   scanf("%d",&S);
      |               ^
Language: C++

#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define fst first;
#define snd second;
#define ALL(obj) (obj).begin(), (obj).end();
#define debug(x) cerr << #x << " -> " << x << " (line:" << __LINE__ << ")" << '\n';
#define debugpair(x, y) cerr << "(" << #x << ", " << #y << ") -> (" << x << ", " << y << ") (line:" << __LINE__ << ")" << '\n';
typedef long long lint;
typedef priority_queue<int> p_que;
typedef priority_queue<int, vector<int>, greater<int>()> p_que_rev;
const int INF = INT_MAX;
const lint LINF = LLONG_MAX;
const int MOD = 1000000000 + 7;
const double EPS = 1e-9;
const double PI = acos(-1);
const int di[]{0, -1, 0, 1, -1, -1, 1, 1};
const int dj[]{1, 0, -1, 0, 1, -1, -1, 1};

/*
6 1
1 2 3 4 5 6
6
*/

lint solve(int n, vector<lint> &a, lint x){
    lint ret = 0;
    // 区間の左端で場合わけ
    for (int l = 0; l < n; ++l){
        lint sum = 0;
        for (int r = l; r <= n; ++r){
            if(r != n){
                sum += a[r];
            }
            // debugpair(l, r);
            // debug(sum);
            if(sum <= x){
                if(r == n){
                    ret += r - l;
                }
                continue;
            }
            else {
                ret += r - l;
                // debug(ret);
                break;
            }
        }
    }
    return ret;
}

int main()
{
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    int n, q;
    cin >> n >> q;
    vector<lint> a(n);
    vector<lint> x(q);
    for (int i=0; i<n; ++i){
        cin >> a[i];
    }
    for (int i=0; i<q; ++i){
        cin >> x[i];
    }
    for (int i=0; i<q; ++i){
        cout << solve(n, a, x[i]) << endl;
    }
    return 0;
}


Compiler output:
a.cc:23:17: error: 'INT_MAX' was not declared in this scope
   23 | const int INF = INT_MAX;
      |                 ^~~~~~~
a.cc:12:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   11 | #include <set>
  +++ |+#include <climits>
   12 | #include <string>
a.cc:24:19: error: 'LLONG_MAX' was not declared in this scope
   24 | const lint LINF = LLONG_MAX;
      |                   ^~~~~~~~~
a.cc:24:19: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

#include <cstudio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
using namespace std;
#define REP(i,n) for (int i=0;i<(n);++i)
#define rep(i,a,b) for(int i=a;i<(b);++i)
template<class T> inline bool chmin(T &a, T b){ if(a > b) { a = b; return true;} return false;}
template<class T> inline bool chmax(T &a, T b){ if(a < b) { a = b; return true;} return false;}
typedef long long ll;
const ll INF = 1LL << 60;
const ll MOD = 1e9 + 7;

ll N,Q,x;
ll A[100010];


int main() {
    scanf("%lld%lld",&N,&Q);
    REP(i,N) scanf("%lld",&A[i]);
    REP(i,Q){
        scanf("%lld",&x);
        ll  sum = 0, ans = 0;
        int r = 0;
        REP(l,N){
            while(r < N && sum + A[r] <= x) sum += A[r++];
            ans += r - l;
            if(r==l) ++r;
            else sum -= A[l];
        }
        cout << ans << endl;
    }
    return 0;
}


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

#include<iostream>
using namespace std;
long long p[1<<17],N,Q,A,sum,cnt;
int main() {
	cin>>N>>Q;for (int i=0;i<N;i++)cin>>p[i];
	while(Q--){
		sum=0,R=0;cin>>A;cnt=0;
		for(int i=0;i<N;i++){
			while(R<N&&sum+p[R]<=A)sum+=p[R++];
			if(sum>0)sum-=p[i];
			cnt+=R-i;if(R<i+1)R=i+1;
		}
		cout<<cnt<<endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:23: error: 'R' was not declared in this scope
    7 |                 sum=0,R=0;cin>>A;cnt=0;
      |                       ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int N,Q;
ll a[100000];

ll solve(ll S){
  ll sum=0,ans=0,k=0;
  for(int i=0;i<N;i++){
    sum+=a[i];
    while(sum>S){
      sum-=a[k];
      k++;
    }
    ans+=(i-k+1);
  }
  return ans;
}

int main(){
  cin>>N>>Q;
  for(int i=0;i<N;i++)cin>>a[i]
  for(int i=0;i<Q;i++){
    ll x;
    cin>>x;
    printf("%lld\n",solve(x));    
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:32: error: expected ';' before 'for'
   22 |   for(int i=0;i<N;i++)cin>>a[i]
      |                                ^
      |                                ;
   23 |   for(int i=0;i<Q;i++){
      |   ~~~                           
a.cc:23:15: error: 'i' was not declared in this scope
   23 |   for(int i=0;i<Q;i++){
      |               ^
Language: C++

import sys
INF = (sys.maxint)/3

def NumberofWindow(N, a_list, S):
	i = 0
	j = 0
	tmpS = a_list[0]
	res = 0
	while j < N  :
		while tmpS <= S and i <N-1:
			i += 1
			tmpS += a_list[i]
		if i == N-1:
			if tmpS > S:
				res += i-j
			else:
				res += i-j+1
		else:
			res += i-j
		tmpS -=a_list[j]
		j += 1
	return res
		

def main():
	N, Q = map(int, raw_input().split())
	a_list = map(int, raw_input().split())
	x_list = map(int, raw_input().split())
	'''
	f = open('DSL_3_C-in21.txt', 'r')
	N, Q = map(int, f.readline().split())
	a_list = map(int, f.readline().split())
	x_list = map(int, f.readline().split())
	'''
	for x in x_list:
		print NumberofWindow(N, a_list, x)
if __name__ == '__main__':
	main()

Compiler output:
a.cc:29:9: error: empty character constant
   29 |         '''
      |         ^~
a.cc:29:11: warning: missing terminating ' character
   29 |         '''
      |           ^
a.cc:29:11: error: missing terminating ' character
a.cc:30:18: warning: multi-character literal with 16 characters exceeds 'int' size of 4 bytes
   30 |         f = open('DSL_3_C-in21.txt', 'r')
      |                  ^~~~~~~~~~~~~~~~~~
a.cc:34:9: error: empty character constant
   34 |         '''
      |         ^~
a.cc:34:11: warning: missing terminating ' character
   34 |         '''
      |           ^
a.cc:34:11: error: missing terminating ' character
a.cc:37:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   37 | if __name__ == '__main__':
      |                ^~~~~~~~~~
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<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<stack>
#include<climits>
#include<cstring>
#include<queue>
#include<fstream>
using namespace std;

const int INF=INT_MAX/3;
typedef unsigned long long ull;

int NumberofWindow(int N, vector<int>&a_list, ull S){
	int i=0;
	int j=0;
	ull tmpS = a_list[0];
	int res = 0;
	while (j < N){
		while ( ( tmpS <=S )&&(i < N-1 ) ){
			i++;
			tmpS += a_list[i];
		} 
		if (i == N-1){
			if (tmpS > S) {
				res += i - j;
			}else{
				res += i-j+1;
			}
		}else{
			res += i-j;
		}
		tmpS -= a_list[j];
		j++;
	}
	return res;
}

int main(){
	int N, Q;
	ull x;
	cin >> N >> Q;
	vector<int> a_list(N);
	for (int i=0;i<N;i++){
		cin >> a_list[i];
	}
	/*
	int N, Q;
	ull x;
	ifstream ifs("DSL_3_C-in10.txt");
	ifs >> N >> Q;
	cout << N << " " << Q <<endl;
	vector<int> a_list(N);
	for (int i=0;i<N;i++){
		ifs >> a_list[i];
	}
	*/
	for (int i=0;i<Q;i++){
		ifs >> x;
		cout <<  NumberofWindow(N, a_list, x) << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:61:17: error: 'ifs' was not declared in this scope; did you mean 'ffs'?
   61 |                 ifs >> x;
      |                 ^~~
      |                 ffs
Language: C++

//#define LOCAL

/*
??????URL???https://pekempey.github.io/lazy_propagation_segment_tree/lazy_propagation_segment_tree.html
*/

#include <fstream>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <cstring>
#include <climits>
#include <set>

#define int long long
typedef long long ll;
//using ll = long long;
//using R = double;

//#define rep(i,n) for(int i=0; i<(n); i++)
#define FOR(i,bg,ed) for(ll i=(bg);i<(ed);i++)
#define REP(i,n) FOR(i,0,n)

#define MOD 1000000007

const int INF = int(1e9);

using namespace std;

typedef vector<int> V;
typedef vector<V> VV;

int N, Q;
int a[100010];
int wa[100010];
int x;

signed main()
{
    cin >> N >> Q;
    int sum = 0;
    REP(i,N) {
        cin >> a[i];
        sum += a[i];
        wa[i] = sum;
    }

    REP(i,Q) {
        cin >> x;
        int ans = 0;
        REP(j,N) {
            int cnt = int(upper_bound(wa, wa + N, wa[j-1] + x) - (wa + j));
            //printf("cnt = %d\n", cnt);
            //printf("upper_bound = %d, minus = %d\n", upper_bound(wa, wa + N, wa[j] + x) - wa, j);
            if (cnt > 0) ans += cnt;
        }
        cout << ans << endl;
    }



    return 0;
}

Compiler output:
a.cc:18:13: error: expected primary-expression before 'long'
   18 | #define int long long
      |             ^~~~
a.cc:29:17: note: in expansion of macro 'int'
   29 | const int INF = int(1e9);
      |                 ^~~
a.cc: In function 'int main()':
a.cc:18:13: error: expected primary-expression before 'long'
   18 | #define int long long
      |             ^~~~
a.cc:55:23: note: in expansion of macro 'int'
   55 |             int cnt = int(upper_bound(wa, wa + N, wa[j-1] + x) - (wa + j));
      |                       ^~~
Language: C++

#include <iostream>
#include <vector>
using namespace std;
using ll = long long;
#define REP(i, n) for (int i = 0; i < n; ++i)
#define FOR(i, m, n) for (int i = m; i < n; ++i)

int main() {
    int n, Q;
    cin >> n >> Q;
    vector<ll> a(n);
    REP(i,n) cin >> a[i];
    REP(j,Q) {
        ll x; cin >> x;
        ll res = 0;
        FOR(left,n) {
            ll sum = 0;
            int right = left;
            while (right < n && sum + a[right] <= x) {
                sum += a[right];
                ++right;
            }
            res += right - left;
        }
        cout << res << endl;
    }
}


Compiler output:
a.cc:16:19: error: macro "FOR" requires 3 arguments, but only 2 given
   16 |         FOR(left,n) {
      |                   ^
a.cc:6:9: note: macro "FOR" defined here
    6 | #define FOR(i, m, n) for (int i = m; i < n; ++i)
      |         ^~~
a.cc: In function 'int main()':
a.cc:16:9: error: 'FOR' was not declared in this scope
   16 |         FOR(left,n) {
      |         ^~~
Language: C++

#include <iostream>
#include <vector>
using namespace std;
using ll = long long;
#define REP(i, n) for (int i = 0; i < n; ++i)

int main() {
    int n, Q;
    cin >> n >> Q;
    vector<ll> a(n);
    REP(i,n) cin >> a[i];
    REP(j,Q) {
        ll x; cin >> x;
        ll res = 0;
        int right = 0;
        ll sum = 0;
        FOR(left,n) {
            while (right < n && sum + a[right] <= x) {
                sum += a[right];
                ++right;
            }
            res += right - left;
            if (right == left) ++right;
            else sum -= a[left];
        }
        cout << res << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: 'FOR' was not declared in this scope
   17 |         FOR(left,n) {
      |         ^~~
Language: Java



import java.util.Scanner;


class Main
{ 
	int st[]; 
	int minVal(int x, int y) { 
		return (x < y) ? x : y; 
	} 

	 
	int getMid(int s, int e) { 
		return s + (e - s) / 2; 
	} 

	
	int RMQUtil(int ss, int se, int qs, int qe, int index) 
	{ 
		 
		if (qs <= ss && qe >= se) 
			return st[index]; 

		
		if (se < qs || ss > qe) 
			return Integer.MAX_VALUE; 

		 
		int mid = getMid(ss, se); 
		return minVal(RMQUtil(ss, mid, qs, qe, 2 * index + 1), 
				RMQUtil(mid + 1, se, qs, qe, 2 * index + 2)); 
	} 

	
	int RMQ(int n, int qs, int qe) 
	{ 
		
		if (qs < 0 || qe > n - 1 || qs > qe) { 
			System.out.println("Invalid Input"); 
			return -1; 
		} 

		return RMQUtil(0, n - 1, qs, qe, 0); 
	} 

	
	int constructSTUtil(int arr[], int ss, int se, int si) 
	{ 
		
		if (ss == se) { 
			st[si] = arr[ss]; 
			return arr[ss]; 
		} 

		
		int mid = getMid(ss, se); 
		st[si] = minVal(constructSTUtil(arr, ss, mid, si * 2 + 1), 
				constructSTUtil(arr, mid + 1, se, si * 2 + 2)); 
		return st[si]; 
	} 

	
	void constructST(int arr[], int n) 
	{ 
		 
		int x = (int) (Math.ceil(Math.log(n) / Math.log(2))); 

		
		int max_size = 2 * (int) Math.pow(2, x) - 1; 
		st = new int[max_size]; 

		 
		constructSTUtil(arr, 0, n - 1, 0); 
	} 

	 
	public static void main(String args[]) 
	{ 
		
		
		Scanner sc = new Scanner(System.in);
		String N = sc.next(); 
		String slide = sc.next();
		Maintree = new SegmentTreeRMQ();
		int arr[] = new int[Integer.parseInt(N)];
		for(int i=0; i<Integer.parseInt(N); i++)
		{
			arr[i] = Integer.parseInt(sc.next());
		}
		
		tree.constructST(arr, Integer.parseInt(N));
		
		for(int i=0;i<=Integer.parseInt(N) - Integer.parseInt(slide);i++) {
			int result=tree.RMQ(Integer.parseInt(N), i, i+Integer.parseInt(slide)-1);
			System.out.print(result+" ");
		}
	} 
} 
 




Compiler output:
Main.java:85: error: cannot find symbol
		Maintree = new SegmentTreeRMQ();
		^
  symbol:   variable Maintree
  location: class Main
Main.java:85: error: cannot find symbol
		Maintree = new SegmentTreeRMQ();
		               ^
  symbol:   class SegmentTreeRMQ
  location: class Main
Main.java:92: error: cannot find symbol
		tree.constructST(arr, Integer.parseInt(N));
		^
  symbol:   variable tree
  location: class Main
Main.java:95: error: cannot find symbol
			int result=tree.RMQ(Integer.parseInt(N), i, i+Integer.parseInt(slide)-1);
			           ^
  symbol:   variable tree
  location: class Main
4 errors
Language: Java



import java.util.Scanner;


class Main
{ 
	int st[]; 
	int minVal(int x, int y) { 
		return (x < y) ? x : y; 
	} 

	 
	int getMid(int s, int e) { 
		return s + (e - s) / 2; 
	} 

	
	int RMQUtil(int ss, int se, int qs, int qe, int index) 
	{ 
		 
		if (qs <= ss && qe >= se) 
			return st[index]; 

		
		if (se < qs || ss > qe) 
			return Integer.MAX_VALUE; 

		 
		int mid = getMid(ss, se); 
		return minVal(RMQUtil(ss, mid, qs, qe, 2 * index + 1), 
				RMQUtil(mid + 1, se, qs, qe, 2 * index + 2)); 
	} 

	
	int RMQ(int n, int qs, int qe) 
	{ 
		
		if (qs < 0 || qe > n - 1 || qs > qe) { 
			System.out.println("Invalid Input"); 
			return -1; 
		} 

		return RMQUtil(0, n - 1, qs, qe, 0); 
	} 

	
	int constructSTUtil(int arr[], int ss, int se, int si) 
	{ 
		
		if (ss == se) { 
			st[si] = arr[ss]; 
			return arr[ss]; 
		} 

		
		int mid = getMid(ss, se); 
		st[si] = minVal(constructSTUtil(arr, ss, mid, si * 2 + 1), 
				constructSTUtil(arr, mid + 1, se, si * 2 + 2)); 
		return st[si]; 
	} 

	
	void constructST(int arr[], int n) 
	{ 
		 
		int x = (int) (Math.ceil(Math.log(n) / Math.log(2))); 

		
		int max_size = 2 * (int) Math.pow(2, x) - 1; 
		st = new int[max_size]; 

		 
		constructSTUtil(arr, 0, n - 1, 0); 
	} 

	 
	public static void main(String args[]) 
	{ 
		
		
		Scanner sc = new Scanner(System.in);
		String N = sc.next(); 
		String slide = sc.next();
		Main tree = new Main();
		int arr[] = new int[Integer.parseInt(N)];
		for(int i=0; i<Integer.parseInt(N); i++)
		{
			arr[i] = Integer.parseInt(sc.next());
		}
		
		tree.constructST(arr, Integer.parseInt(N));
		
		for(int i=0;i<=Integer.parseInt(N) - Integer.parseInt(slide);i++) {
			int result=tree.RMQ(Integer.parseInt(N), i, i+Integer.parseInt(slide)-1);
			if(i!= Integer.paresInt(N) - Integer.parseInt(slide)){
					System.out.print(result+" ");
				}else{
					System.out.println(result);
				}
		}
	} 
} 
 





Compiler output:
Main.java:96: error: cannot find symbol
			if(i!= Integer.paresInt(N) - Integer.parseInt(slide)){
			              ^
  symbol:   method paresInt(String)
  location: class Integer
1 error
Language: C++

#include<iostream>
#include<deque>

using namespace std;

typedef long long ll;

#define rep(i,n) for(ll i=0;i<(n);i++)

ll N,L,a[1000000],b[1000000];
deque<ll> deq;

int main() {
    cin >> N >> L;

    rep(i,N)cin >> a[i];

    rep(i,N) {

        while(!deq.empty() && a[deq[deq.size() - 1]] >= a[i]) deq.pop_back();
        deq.push_back(i);

        if(i - L + 1 >= 0) {
            b[i - L + 1] = a[deq[0]];

            if(deq[0] == i - L + 1) {
                deq.pop_front();
            }
        }
    }

    rep(i,N - L + 1) {
        cout << b[i];
        if(i < N - L)cout << " ";
    }
    cout << endl;
    return 0;



Compiler output:
a.cc: In function 'int main()':
a.cc:37:14: error: expected '}' at end of input
   37 |     return 0;
      |              ^
a.cc:13:12: note: to match this '{'
   13 | int main() {
      |            ^
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
using namespace std;
#define REP(i,n) for (int i=0;i<(n);++i)

int N,K;

int main() {
    cin.tie(0); ios_base::sync_with_stdio(false);
    cin >> N >> K;
    vector<int> a(N);
    REP(i,N) cin >> a[i];
    int l = 0, r = 0;
    ll mn1 = INF, mn2 = INF, mn3 = INF;
    for(;;){
        while(r - l < K){
            if(a[r] < mn1){
                mn2 = mn1;
                mn1 = a[r];
            } else if(a[r] < mn2){
                mn3 = mn2;
                mn2 = a[r];
            } else if (a[r] < mn3){
                mn3 = a[r];
            }
            ++r;
        }
        cout << mn1;
        if(r!=N) cout << " ";
        else break;
        if(a[l++]==mn1){
            mn1 = mn2;
            mn2 = mn3;
        }
    }
    cout << '\n';
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:5: error: 'll' was not declared in this scope; did you mean 'l'?
   17 |     ll mn1 = INF, mn2 = INF, mn3 = INF;
      |     ^~
      |     l
a.cc:20:23: error: 'mn1' was not declared in this scope
   20 |             if(a[r] < mn1){
      |                       ^~~
a.cc:21:17: error: 'mn2' was not declared in this scope
   21 |                 mn2 = mn1;
      |                 ^~~
a.cc:23:30: error: 'mn2' was not declared in this scope
   23 |             } else if(a[r] < mn2){
      |                              ^~~
a.cc:24:17: error: 'mn3' was not declared in this scope
   24 |                 mn3 = mn2;
      |                 ^~~
a.cc:26:31: error: 'mn3' was not declared in this scope
   26 |             } else if (a[r] < mn3){
      |                               ^~~
a.cc:31:17: error: 'mn1' was not declared in this scope
   31 |         cout << mn1;
      |                 ^~~
a.cc:35:19: error: 'mn2' was not declared in this scope
   35 |             mn1 = mn2;
      |                   ^~~
a.cc:36:19: error: 'mn3' was not declared in this scope
   36 |             mn2 = mn3;
      |                   ^~~
Language: C++

answer=[]
element=[]
D=[]
def initRMQ(nn):
    global n
    n = 1
    while n < nn:
        n*=2
    for i in range(2*n-1):
        D.append(2147483647)

def update(k,a):
    k += n-1
    D[k] = a
    while k>0:
        k = (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):
    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, (l+r)//2)
    vr = query(a, b, (k*2)+2, (l+r)//2, r)
    return min(vl,vr)


N,L = map(int,input().split())
initRMQ(N)
element = input().split()
for i in range(len(element)):
    update(i,int(element[i]))
for i in range(N-L+1):
    answer.append(findMin(i,i+L))
            
for i in range(len(answer)):
    print(answer[i],end='') 


Compiler output:
a.cc:42:25: error: empty character constant
   42 |     print(answer[i],end='')
      |                         ^~
a.cc:1:1: error: 'answer' does not name a type
    1 | answer=[]
      | ^~~~~~
Language: C++

answer=[]
element=[]
D=[]
def initRMQ(nn):
    global n
    n = 1
    while n < nn:
        n*=2
    for i in range(2*n-1):
        D.append(2147483647)

def update(k,a):
    k += n-1
    D[k] = a
    while k>0:
        k = (k-1)//2
        D[k] = min(D[k*2+1] , D[k*2+2])
        
def findMin(a,b):
    return query(a,b,0,0,n)

def query(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, (l+r)//2)
    vr = query(a, b, (k*2)+2, (l+r)//2, r)
    return min(vl,vr)


N,L = map(int,input().split())
initRMQ(N)
element = input().split()
for i in range(len(element)):
    update(i,int(element[i]))
for i in range(N-L+1):
    answer.append(findMin(i,i+L))
            
for i in range(len(answer)):
    print(answer[i],end='')


Compiler output:
a.cc:42:25: error: empty character constant
   42 |     print(answer[i],end='')
      |                         ^~
a.cc:1:1: error: 'answer' does not name a type
    1 | answer=[]
      | ^~~~~~
Language: C++

#define NDEBUG
#include<deque>
#include<functional>
#include<utility>
#include<cstddef>
#include<cassert>

template<typename T, class Compare = std::less<T>>
class SlidingMinimum{
public:
	using value_compare = Compare;
	using value_type = T;
private:
	using size_type = std::size_t;
	using container_type = std::deque<std::pair<const value_type, size_type>>;
	container_type c;
	value_compare comp;
public:
	SlidingMinimum(const value_compare &x = value_compare()) :comp(x){}
	SlidingMinimum(const size_type s, const value_compare &x = value_compare()) :comp(x){
		c.reserve(s);
	}
	const value_type &top()const{
		return c.front().first;
	}
	const size_type top_index()const{
		return c.front().second - 1;
	}
	void push(const value_type &x){
		size_type s = 1;
		while (!c.empty() && comp(x, c.back().first)){
			s += c.back().second;
			c.pop_back();
		}
		c.push_back(std::pair<const value_type, size_type>(x, s));
	}
	void push(value_type &&x){
		size_type s = 1;
		while (!c.empty() && comp(x, c.back().first)){
			s += c.back().second;
			c.pop_back();
		}
		c.push_back(std::pair<const value_type, size_type>(std::move(x), s));
	}
	void pop(){
		assert(!c.empty());
		if (!(--c.front().second))
			c.pop_front();
	}
};


#include<cstdio>
#include<utility>

int main(){
	int n, l;
	scanf("%d%d", &n, &l);
	SlidingMinimum<int> S(l);
	int a;
	n -= l;
	while (l--){
		scanf("%d", &a);
		S.push(a);
	}
	printf("%d", S.top());
	while (n--){
		S.pop();
		scanf("%d", &a);
		S.push(a);
		printf(" %d", S.top());
	}
	printf("\n");
	return 0;
}



Compiler output:
a.cc: In instantiation of 'SlidingMinimum<T, Compare>::SlidingMinimum(size_type, const value_compare&) [with T = int; Compare = std::less<int>; size_type = long unsigned int; value_compare = std::less<int>]':
a.cc:59:25:   required from here
   59 |         SlidingMinimum<int> S(l);
      |                                ^
a.cc:21:19: error: 'using SlidingMinimum<int>::container_type = class std::deque<std::pair<const int, long unsigned int>, std::allocator<std::pair<const int, long unsigned int> > >' {aka 'class std::deque<std::pair<const int, long unsigned int>, std::allocator<std::pair<const int, long unsigned int> > >'} has no member named 'reserve'
   21 |                 c.reserve(s);
      |                 ~~^~~~~~~
Language: C++

#define NDEBUG
#include<deque>
#include<functional>
#include<utility>
#include<cstddef>
#include<cassert>

template<class T,class Container=std::deque<const std::pair<T,std::size_t>>, class Compare = std::less<T>>
class SlidingMinimum{
public:
	using container_type = Container;
	using value_compare = Compare;
	using value_type = T;
	using size_type = typename container_type::size_type;
	using const_reference = const T&;
private:
	container_type c;
	value_compare comp;
	size_type s;
public:
	SlidingMinimum(const value_compare &x = value_compare()) :comp(x),s(1){}
	bool empty()const{
		return c.empty();
	}
	const_reference top()const{
		assert(!empty());
		return c.front().first;
	}
	size_type top_index()const{
		assert(!empty());
		return c.front().second - s;
	}
	void push(const value_type &x){
		size_type cnt = 1;
		while (!empty() && comp(x, c.back().first)){
			cnt += c.back().second;
			c.pop_back();
		}
		c.push_back(std::pair<value_type, size_type>(x, cnt));
	}
	void push(value_type &&x){
		size_type cnt = 1;
		while (!empty() && comp(x, c.back().first)){
			cnt += c.back().second;
			c.pop_back();
		}
		c.push_back(std::pair<value_type, size_type>(std::move(x), s));
	}
	void pop(){
		assert(!empty());
		if (c.front().second == s){
			c.pop_front();
			s = 0;
		}
		++s;
	}
	void clear(){
		c.clear();
		s = 1;
	}
};





#include<cstdio>
#include<utility>

int main(){
	using uint = unsigned int;
	uint n, l;
	scanf("%u%u", &n, &l);
	SlidingMinimum<uint> S;
	uint a;
	n -= l;
	while (l--){
		scanf("%u", &a);
		S.push(a);
	}
	printf("%u", S.top());
	while (n--){
		S.pop();
		scanf("%u", &a);
		S.push(a);
		printf(" %u", S.top());
	}
	printf("\n");
	return 0;
}


Compiler output:
In file included from /usr/include/c++/14/deque:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_deque.h: In instantiation of 'class std::deque<const std::pair<unsigned int, long unsigned int>, std::allocator<const std::pair<unsigned int, long unsigned int> > >':
a.cc:14:8:   required from 'class SlidingMinimum<unsigned int>'
   14 |         using size_type = typename container_type::size_type;
      |               ^~~~~~~~~
a.cc:74:23:   required from here
   74 |         SlidingMinimum<uint> S;
      |                              ^
/usr/include/c++/14/bits/stl_deque.h:800:66: error: static assertion failed: std::deque must have a non-const, non-volatile value_type
  800 |       static_assert(is_same<typename remove_cv<_Tp>::type, _Tp>::value,
      |                                                                  ^~~~~
/usr/include/c++/14/bits/stl_deque.h:800:66: note: 'std::integral_constant<bool, false>::value' evaluates to false
Language: C++

#include <stdio.h>
#include <queue>
#include <utility>
using namespace std;
int main(){
    int N,L,atmp;
    priority_queue<pair<int,int>,vector<pair<int,int> >,greater<pair<int,int> > >pq;
    scanf("%d%d",&N,&L);
    for(int i=0;i<L;i++){
        scanf("%d",&atmp);
        pq.push(make_pair(atmp,i));
    }
    printf("%d",pq.top().first);
    for(int i=L;i<N;i++){
        scanf("%d",&atmp);
        pq.push(make_pair(atmp,i));
        while(pq.top().second<=i-l)pq.pop();
        printf(" %d",pq.top().first);
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:34: error: 'l' was not declared in this scope
   17 |         while(pq.top().second<=i-l)pq.pop();
      |                                  ^
Language: C++

#include<bits/stdc++.h>
#define x first
#define ys second.first
#define yt second.second

using namespace std;

typedef pair<int,int> pii;
typedef pair<int,pii> pip; 

struct node
{
	int num,l,r,ls,rs;
	node(int _l,int _r)
	{
		num=0;
		l=_l;
		r=_r;
	}
};

vector<node> T;
vector<int> d;

int make(int l,int r)
{
	int id=T.size();
	T.push_back(node(l,r));
	T[id].ls=(l+1==r?-1:make(l,(l+r)/2));
	T[id].rs=(l+1==r?-1:make((l+r)/2,r));
	return id;
}

void update(int id,int l,int r,int t)
{
	if(l==r||T[id].l>=r||T[id].r<=l)
		return ;
	if(T[id].l>=l&&T[id].r<=r)
	{
		T[id].num+=t;
		return ;
	}
	int mid=(T[id].l+T[id].r)>>1;
	if(l<mid)
		update(T[id].ls,l,r,t);
	if(r>mid)
		update(T[id].rs,l,r,t);
	int mi=min(T[T[id].ls].num,T[T[id].rs].num);
	T[id].num+=mi;
	T[T[id].ls].num-=mi;
	T[T[id].rs].num-=mi;
}

int gettot(int id)
{
	if(id==-1) return 0; 
	if(T[id].num>0)
	{
		//printf("|%d %d %d %d\n",T[id].l,T[id].r,d[T[id].l],d[T[id].r]);
		return d[T[id].r]-d[T[id].l];
	}
	return gettot(T[id].ls)+gettot(T[id].rs);
}

int main()
{
	T.reserve(5000);
	int n;
	scanf("%d",&n);
	set<int> s;
	priority_queue<pip,vector<pip>,greater<pip> > pq; 
	for(int i=0;i<n;i++)
	{
		int x1,y1,x2,y2;
		scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
		s.insert(y1);s.insert(y2);
		pq.push(make_pair(x1,make_pair(y1,y2)));
		pq.push(make_pair(x2,make_pair(y2,y1)));
	}
	map<int,int> y;
	d.clear();
	for(set<int>::iterator it=s.begin();it!=s.end();it++)
	{
		y[*it]=d.size();
		d.push_back(*it);
	}
	make(0,d.size()-1);
	//for(int i=0;i<T.size();i++) printf("%d %d %d %d %d %d\n",i,T[i].num,T[i].l,T[i].r,T[i].ls,T[i].rs);
	//for(int i=0;i<d.size();i++) printf("%d\n",d[i]);
	ll ans=0;
	while(true)
	{
		pip t=pq.top();pq.pop();
		if(pq.empty()) break;
		if(t.second.first<t.second.second)
		{
			//printf("%d %d\n",y[t.second.first],y[t.second.second]);
			update(0,y[t.second.first],y[t.second.second],1);
		}
		else
			update(0,y[t.second.second],y[t.second.first],-1);
		//for(int i=0;i<T.size();i++) printf("%d %d %d %d %d %d\n",i,T[i].num,T[i].l,T[i].r,T[i].ls,T[i].rs);
		//printf("||%d %d %d\n",gettot(0),t.x,pq.top().x);
		ans+=gettot(0)*(pq.top().x-t.x);
	}
	printf("%lld\n",ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:90:9: error: 'll' was not declared in this scope
   90 |         ll ans=0;
      |         ^~
a.cc:104:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
  104 |                 ans+=gettot(0)*(pq.top().x-t.x);
      |                 ^~~
      |                 abs
a.cc:106:25: error: 'ans' was not declared in this scope; did you mean 'abs'?
  106 |         printf("%lld\n",ans);
      |                         ^~~
      |                         abs
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#define ll long long
using namespace std;
//
int n;
vector<ll> px,py,qx,qy;
int dp[4100][4100];
struct vevev{
	vector<ll> a;vector<ll> b;vector<ll> ab;
};
vevev compress(vector<ll> x1,vector<ll> x2){
	vector<ll> xs;
	for(int i=0;i<n;i++){
		for(int j=0;j<=1;j++){
			xs.push_back(x1[i]+j);
			xs.push_back(x2[i]+j);
		}
	}
	xs.push_back(1e9+7);
	sort(xs.begin(),xs.end());
	xs.erase(unique(xs.begin(),xs.end()),xs.end());
	for(int i=0;i<n;i++){
		x1[i]=lower_bound(xs.begin(),xs.end(),x1[i])-xs.begin();
		x2[i]=lower_bound(xs.begin(),xs.end(),x2[i])-xs.begin();
	}
	vevev v;
	v.a=x1;v.b=x2;v.ab=xs;
	return v;
}
//
int main(){
	cin>>n;
	px.resize(n);
	py.resize(n);
	qx.resize(n);
	qy.resize(n);
	for(int i=0;i<n;i++){
		cin>>px[i]>>py[i]>>qx[i]>>qy[i];
	}
	vevev x=compress(px,qx);
	vevev y=compress(py,qy);
	px=x.a;qx=x.b;vector<int> X=x.ab;
	py=y.a;qy=y.b;vector<int> Y=y.ab;
	for(int i=0;i<n;i++){
		dp[px[i]][py[i]]++;
		dp[qx[i]][qy[i]]++;
		dp[px[i]][qy[i]]--;
		dp[qx[i]][py[i]]--;
	}
	for(int i=0;i<X.size()-1;i++){
		for(int j=1;j<Y.size()-1;j++){
			dp[i][j]+=dp[i][j-1];
		}
	}
	for(int i=0;i<Y.size()-1;i++){
		for(int j=1;j<X.size()-1;j++){
			dp[j][i]+=dp[j-1][i];
		}
	}
	ll ans=0;
	for(int i=0;i<X.size()-1;i++){
		for(int j=0;j<Y.size()-1;j++){
			if(dp[i][j]){
				ans+=(X[i+1]-X[i])*(Y[j+1]-Y[j]);
			}
		}
	}
	cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:44:39: error: conversion from 'vector<long long int>' to non-scalar type 'vector<int>' requested
   44 |         px=x.a;qx=x.b;vector<int> X=x.ab;
      |                                     ~~^~
a.cc:45:39: error: conversion from 'vector<long long int>' to non-scalar type 'vector<int>' requested
   45 |         py=y.a;qy=y.b;vector<int> Y=y.ab;
      |                                     ~~^~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#define ll long long
using namespace std;
//
int n;
ll px[4000],py[4000],qx[4000],qy[4000];
ll dp[6000][6000];
vector<ll> compress(int* x1,int* x2){
	vector<ll> xs;
	for(int i=0;i<n;i++){
		for(int j=-1;j<=1;j++){
			xs.push_back(x1[i]+j);
			xs.push_back(x2[i]+j);
		}
	}
	xs.push_back(1e18+7);
	sort(xs.begin(),xs.end());
	xs.erase(unique(xs.begin(),xs.end()),xs.end());
	for(int i=0;i<n;i++){
		x1[i]=lower_bound(xs.begin(),xs.end(),x1[i])-xs.begin();
		x2[i]=lower_bound(xs.begin(),xs.end(),x2[i])-xs.begin();
	};
	return xs;
}
//
int main(){
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>px[i]>>py[i]>>qx[i]>>qy[i];
	}
	vector<ll> X=compress(px,qx);
	vector<ll> Y=compress(py,qy);
	for(int i=0;i<n;i++){
		dp[px[i]][py[i]]++;
		dp[qx[i]][qy[i]]++;
		dp[px[i]][qy[i]]--;
		dp[qx[i]][py[i]]--;
	}
	for(int i=0;i<X.size()-1;i++){
		for(int j=1;j<Y.size()-1;j++){
			dp[i][j]+=dp[i][j-1];
		}
	}
	for(int i=0;i<Y.size()-1;i++){
		for(int j=1;j<X.size()-1;j++){
			dp[j][i]+=dp[j-1][i];
		}
	}
	ll ans=0;
	for(int i=0;i<X.size()-1;i++){
		for(int j=0;j<Y.size()-1;j++){
			if(dp[i][j]>0){
				ans+=(X[i+1]-X[i])*(Y[j+1]-Y[j]);
			}
		}
	}
	cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:31: error: cannot convert 'long long int*' to 'int*'
   33 |         vector<ll> X=compress(px,qx);
      |                               ^~
      |                               |
      |                               long long int*
a.cc:10:26: note:   initializing argument 1 of 'std::vector<long long int> compress(int*, int*)'
   10 | vector<ll> compress(int* x1,int* x2){
      |                     ~~~~~^~
a.cc:34:31: error: cannot convert 'long long int*' to 'int*'
   34 |         vector<ll> Y=compress(py,qy);
      |                               ^~
      |                               |
      |                               long long int*
a.cc:10:26: note:   initializing argument 1 of 'std::vector<long long int> compress(int*, int*)'
   10 | vector<ll> compress(int* x1,int* x2){
      |                     ~~~~~^~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#define ll long long
using namespace std;
//
int n;
vector<ll> px,py,qx,qy;
int dp[4100][4100];
struct vevev{
	vector<ll> a;vector<ll> b;vector<ll> ab;
};
vevev compress(vector<ll> x1,vector<ll> x2){
	vector<ll> xs;
	for(int i=0;i<n;i++){
		for(int j=0;j<=1;j++){
			xs.push_back(x1[i]+j);
			xs.push_back(x2[i]+j);
		}
	}
	xs.push_back(1e9+7);
	sort(xs.begin(),xs.end());
	xs.erase(unique(xs.begin(),xs.end()),xs.end());
	for(int i=0;i<n;i++){
		x1[i]=lower_bound(xs.begin(),xs.end(),x1[i])-xs.begin();
		x2[i]=lower_bound(xs.begin(),xs.end(),x2[i])-xs.begin();
	}
	vevev v;
	v.a=x1;v.b=x2;v.ab=xs;
	return v;
}
//
int main(){
	cin>>n;
	px.resize(n);
	py.resize(n);
	qx.resize(n);
	qy.resize(n);
	for(int i=0;i<n;i++){
		cin>>px[i]>>py[i]>>qx[i]>>qy[i];
	}
	vevev x=compress(px,qx);
	vevev y=compress(py,qy);
	px=x.a;qx=x.b;vector<int> X=x.ab;
	py=y.a;qy=y.b;vector<int> Y=y.ab;
	for(int i=0;i<n;i++){
		dp[px[i]][py[i]]++;
		dp[qx[i]][qy[i]]++;
		dp[px[i]][qy[i]]--;
		dp[qx[i]][py[i]]--;
	}
	for(int i=0;i<X.size()-1;i++){
		for(int j=1;j<Y.size()-1;j++){
			dp[i][j]+=dp[i][j-1];
		}
	}
	for(int i=0;i<Y.size()-1;i++){
		for(int j=1;j<X.size()-1;j++){
			dp[j][i]+=dp[j-1][i];
		}
	}
	int ans=0;
	for(int i=0;i<X.size()-1;i++){
		for(int j=0;j<Y.size()-1;j++){
			if(dp[i][j]){
				ans+=(X[i+1]-X[i])*(Y[j+1]-Y[j]);
			}
		}
	}
	cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:44:39: error: conversion from 'vector<long long int>' to non-scalar type 'vector<int>' requested
   44 |         px=x.a;qx=x.b;vector<int> X=x.ab;
      |                                     ~~^~
a.cc:45:39: error: conversion from 'vector<long long int>' to non-scalar type 'vector<int>' requested
   45 |         py=y.a;qy=y.b;vector<int> Y=y.ab;
      |                                     ~~^~
Language: C

#include<stdio.h>
#define TMAX 100001
int main(void){
	int N, T, time[TMAX]={0}, in, out, max=0, i, j;
	scanf("%d%d", &N, &T);
	for(j=0; j<T; j++){
		*(time+j) = N;
	}
	for(i=0; i<N; i++){
		scanf("%d%d", &in, &out);
		if(0 != in || T != out){
			for(j=0; j<in; j++){
				*(time+j) -= 1;
			}
			for(j=out; j<=T; j++){
				*(time+j) -= 1;
			}
		}
	}
	for(j=0; j<T; j++){
		max = (max < *(time+j) ? *(time+j) : max);
		printf("%6d %6d %6d\n", j, *(time+j), max);	//
	}
	printf("%d\n", max);
	return 0;

Compiler output:
main.c: In function 'main':
main.c:25:9: error: expected declaration or statement at end of input
   25 |         return 0;
      |         ^~~~~~
Language: C

n, t = list(map(lambda x: int(x), input().split(" ")))
guests = [list(map(lambda x: int(x), input().split(" "))) for x in range(n)]

events = []
for guest in guests:
    events.append([guest[0], 1])
    events.append([guest[1], -1])

events.sort(key=lambda x: (x[0], x[1]))

max = 0
count = 0
for event in events:
    count += event[1]
    if count>max: max = count

print(max)


Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | n, t = list(map(lambda x: int(x), input().split(" ")))
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:1:4: error: type defaults to 'int' in declaration of 't' [-Wimplicit-int]
    1 | n, t = list(map(lambda x: int(x), input().split(" ")))
      |    ^
main.c:1:8: error: implicit declaration of function 'list' [-Wimplicit-function-declaration]
    1 | n, t = list(map(lambda x: int(x), input().split(" ")))
      |        ^~~~
main.c:1:13: error: implicit declaration of function 'map' [-Wimplicit-function-declaration]
    1 | n, t = list(map(lambda x: int(x), input().split(" ")))
      |             ^~~
main.c:1:17: error: 'lambda' undeclared here (not in a function)
    1 | n, t = list(map(lambda x: int(x), input().split(" ")))
      |                 ^~~~~~
main.c:1:23: error: expected ')' before 'x'
    1 | n, t = list(map(lambda x: int(x), input().split(" ")))
      |                ~      ^~
      |                       )
main.c:2:1: error: expected ',' or ';' before 'guests'
    2 | guests = [list(map(lambda x: int(x), input().split(" "))) for x in range(n)]
      | ^~~~~~
Language: C++

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

int main(void){
int n,t,c,max;
cin>>n>>t;
vector<int> ln,rn;
ln.resize(t);
rn.resize(t);
int r,l;
for(int i=0;i<n;i++){
 cin>>l>>r;
 ln[l]+=1;
 rn[r]+=1;
}
c=0;
max=0;
for(int i=0;i<t;i++){
 c+=ln[i];
 c-=rn[i];
 if(c>max) max=c;
}



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

#include <bits/stdc++.h>
#include "../../printer.hpp"
using namespace std;
typedef long long ll;
#define REP(i,n) FOR(i,0,n)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define PB push_back
#define LB lower_bound
#define UB upper_bound
#define PQ priority_queue
#define UM unordered_map
#define ALL(a) (a).begin(),(a).end()
typedef vector<ll> vi;
typedef vector<vector<ll>> vvi;
const ll INF = (1ll << 60);
typedef pair<ll,ll> pii;

int main(){
  ll N,T; cin>>N>>T;
  vi l(N),r(N); REP(i,N) cin>>l[i]>>r[i];
  vi tl(T+1),tr(T+1);
  REP(i,N) {tl[l[i]]+=1; tr[r[i]]+=1;}
  ll num=0,ans=0;
  FOR(t,0,T+1) {num+=tl[t]-tr[t]; ans=max(ans,num);}
  cout<<ans<<endl;
}

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

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

int main(){

  int N,T;
  cin >> N >> T;

  int a[100000] = {};
  for(int i = 0; i < N; i++){
    int l,r;
    cin >> l >> r;

    a[l]++; a[r]--;
    }
  }

  for(int i = 1; i < T; i++){
    a[i] +=a[i-1];
  }

  int ans = 0;
  for(int i = 0; i < T; i++){
    ans = max(ans,a[i]);
  }

  cout << ans << endl;

  return 0;
}
/*

int main(){

  int N,T;
  cin >> N >> T;

  int a[100000] = {};
  for(int i = 0; i < N; i++){
    int l,r;
    cin >> l >> r;

    a[l]++; a[r]--;


  }

  int ans = 0;
  for(int i = 0; i < 100000; i++){
    if(a[i] >= 1)ans = max(ans,a[i]);
  }

  cout << ans << endl;

  return 0;
}



Compiler output:
a.cc:31:1: error: unterminated comment
   31 | /*
      | ^
a.cc:18:3: error: expected unqualified-id before 'for'
   18 |   for(int i = 1; i < T; i++){
      |   ^~~
a.cc:18:18: error: 'i' does not name a type
   18 |   for(int i = 1; i < T; i++){
      |                  ^
a.cc:18:25: error: 'i' does not name a type
   18 |   for(int i = 1; i < T; i++){
      |                         ^
a.cc:23:3: error: expected unqualified-id before 'for'
   23 |   for(int i = 0; i < T; i++){
      |   ^~~
a.cc:23:18: error: 'i' does not name a type
   23 |   for(int i = 0; i < T; i++){
      |                  ^
a.cc:23:25: error: 'i' does not name a type
   23 |   for(int i = 0; i < T; i++){
      |                         ^
a.cc:27:3: error: 'cout' does not name a type
   27 |   cout << ans << endl;
      |   ^~~~
a.cc:29:3: error: expected unqualified-id before 'return'
   29 |   return 0;
      |   ^~~~~~
a.cc:30:1: error: expected declaration before '}' token
   30 | }
      | ^
Language: C

#include "stdio.h"
#include<algorithm>
using namespace std;
int v[1002][1002],a[4],n,i,j,c;

int main()
{
	for (scanf_s("%d",&n);~scanf_s("%d %d %d %d",&n,&i,&j,&c);v[j][i]-=1){v[n][i] += 1;v[j][c] += 1;v[n][c] -= 1;}
	for (i = 0; j = i<1002; i++)for (; j<1002; v[i][j] += v[i][j++-1]);
	for (j = 0; i = j<1002; i++)for (; i<1002; v[i][j] += v[i++-1][j]);
	for (i = 0; i<1002; i++) {
		for (j = 0; j < 1002; j++) {
			c = max(c, v[i][j]);
		}
	}
	printf("%d\n", c);
	scanf_s("%d",&n);
	return 0;
}




Compiler output:
main.c:2:9: fatal error: algorithm: No such file or directory
    2 | #include<algorithm>
      |         ^~~~~~~~~~~
compilation terminated.
Language: C++

#include <cstdio>
#include <vector>
#include <set>
#include <map>
using namespace std;
long long solve(const vector<pair<pair<int,int>,pair<int,int>>> &v){
	set<int>lx,ly;
	for(auto &e:v){
		lx.insert(e.first.first);lx.insert(e.second.first);
		ly.insert(e.first.second);ly.insert(e.second.second);
	}
	int i;
	map<int,int>mx,my,sx,sy;
	i=0;for(auto ix1=lx.begin(),ix2=lx.begin();++ix2!=lx.end();++ix1,++i){
		mx[*ix1]=i,sx[i]=*ix2-*ix1;
	}
	mx[*lx.rbegin()]=i,sx[i]=0;
	i=0;for(auto iy1=ly.begin(),iy2=ly.begin();++iy2!=ly.end();++iy1,++i){
		my[*iy1]=i,sy[i]=*iy2-*iy1;
	}
	my[*ly.rbegin()]=i,sy[i]=0;
	vector<vector<int>>m(my.size());
	for(auto &e:m)e.resize(mx.size());
#if 0
	for(auto &e:v){
		for(int y=my[e.first.second];y<my[e.second.second];y++)
			for(int x=mx[e.first.first];x<mx[e.second.first];x++)m[y][x]++;
	}
#else
	for(auto &e:v){
		m[my[e.first.second]][mx[e.first.first]]++;
		m[my[e.second.second]][mx[e.first.first]]--;
		m[my[e.first.second]][mx[e.second.first]]--;
		m[my[e.second.second]][mx[e.second.first]]++;
	}
	for(int y=0;y<sy.size();y++)for(int x=1;x<sx.size();x++)m[y][x]+=m[y][x-1];
	for(int y=1;y<sy.size();y++)for(int x=0;x<sx.size();x++)m[y][x]+=m[y-1][x];
#endif
	long long r=0;
	for(int y=0;y<sy.size();y++)for(int x=0;x<sx.size();x++)r=max(r,m[y][x]);
	return r;
}
int main(){
	int N,x1,y1,x2,y2;
	vector<pair<pair<int,int>,pair<int,int>>>v;
	scanf("%d",&N);
	for(int i=0;i<N;i++){
		scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
		v.push_back({{x1,y1},{x2,y2}});
	}
	printf("%lld\n",solve(v));
}

Compiler output:
a.cc: In function 'long long int solve(const std::vector<std::pair<std::pair<int, int>, std::pair<int, int> > >&)':
a.cc:40:70: error: no matching function for call to 'max(long long int&, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)'
   40 |         for(int y=0;y<sy.size();y++)for(int x=0;x<sx.size();x++)r=max(r,m[y][x]);
      |                                                                   ~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/vector:62,
                 from a.cc:2:
/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:40:70: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'})
   40 |         for(int y=0;y<sy.size();y++)for(int x=0;x<sx.size();x++)r=max(r,m[y][x]);
      |                                                                   ~~~^~~~~~~~~~~
/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
Language: C++

#include "stdio.h"
#include"algorithm.h""
using namespace std;
int v[1002][1002],a[4],n,i,j,c;

int main()
{
	for (scanf_s("%d",&n);~scanf_s("%d %d %d %d",&n,&i,&j,&c);v[j][i]-=1){v[n][i] += 1;v[j][c] += 1;v[n][c] -= 1;}
	for (i = 0; j = i<1002; i++)for (; j<1002; v[i][j] += v[i][j++-1]);
	for (j = 0; i = j<1002; i++)for (; i<1002; v[i][j] += v[i++-1][j]);
	for (i = 0; i<1002; i++) {
		for (j = 0; j < 1002; j++) {
			c = max(c, v[i][j]);
		}
	}
	printf("%d\n", c);
	scanf_s("%d",&n);
	return 0;
}


Compiler output:
a.cc:2:22: warning: missing terminating " character
    2 | #include"algorithm.h""
      |                      ^
a.cc:2:22: warning: extra tokens at end of #include directive
a.cc:2:9: fatal error: algorithm.h: No such file or directory
    2 | #include"algorithm.h""
      |         ^~~~~~~~~~~~~
compilation terminated.
Language: Java

// GRL_1_A: SSSP, nonnegative edges (Dijkstra's)

import java.util.*;

public class SSSP_1a {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int m = sc.nextInt();
    int source = sc.nextInt();

    Map<Integer, Integer> cost = new HashMap<Integer, Integer>();
    cost.put(source, 0);

    // representing vertices as int[] with values {id, tentative cost}
    PriorityQueue<int[]> pq =
        new PriorityQueue<int[]>(
            new Comparator<int[]>() {
              public int compare(int[] v1, int[] v2) {
                return Integer.compare(v1[1], v2[1]);
              }
            });

    // populate adjacency list
    // adj[i] = list of all edges from node i
    ArrayList<ArrayList<int[]>> adj = new ArrayList<ArrayList<int[]>>();
    for (int i = 0; i < n; ++i) adj.add(new ArrayList<int[]>());
    for (int i = 0; i < m; ++i) {
      int src = sc.nextInt();
      int dst = sc.nextInt();
      int edgeCost = sc.nextInt();
      adj.get(src).add(new int[] {dst, edgeCost});
    }

    // populate priority queue with neighbors of the source node 0
    for (int[] e : adj.get(source)) {
      pq.add(new int[] {e[0], e[1]});
    }

    while (!pq.isEmpty() && cost.size() < n) {
      int[] v = pq.remove(); // cheapest vertex
      if (!cost.containsKey(v[0])) {
        cost.put(v[0], v[1]);
        for (int[] e : adj.get(v[0])) {
          pq.add(new int[] {e[0], v[1] + e[1]});
        }
      }
    }

    for (int i = 0; i < n; ++i) {
      if (cost.containsKey(i)) {
        System.out.println(cost.get(i));
      } else {
        System.out.println("INF");
      }
    }
  }
}


Compiler output:
Main.java:5: error: class SSSP_1a is public, should be declared in a file named SSSP_1a.java
public class SSSP_1a {
       ^
1 error