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

#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
#define scii(x, y) int x,y;scanf("%d%d",&x,&y);
#define REP(i, y) for(int i=0;i<y;i++)

const int MAX_N = 110;
const int MAX_W = 1000000010;

int dp[MAX_N][MAX_W];
int w[MAX_N];
int v[MAX_N];

int main() {
  scii(N, W)
  REP(i,N) {
    scanf("%d%d",&w[i], &v[i]);
  }

  REP(i, N+1) {
    REP(c, W+1) {
      if (i==0||c==0)
        dp[i][c] = 0;
      else if (c >= w[i-1]) {
        dp[i][c] = max(v[i-1] + dp[i-1][c-w[i-1]], dp[i-1][c]);
      } else {
        dp[i][c] = dp[i-1][c];
      }
    }
  }
  printf("%d\n", dp[N][W]);
}

Compiler output:
/tmp/ccBXviCp.o: in function `main':
a.cc:(.text+0x40): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/ccBXviCp.o
a.cc:(.text+0x57): relocation truncated to fit: R_X86_64_PC32 against symbol `w' defined in .bss section in /tmp/ccBXviCp.o
a.cc:(.text+0xe8): relocation truncated to fit: R_X86_64_PC32 against symbol `w' defined in .bss section in /tmp/ccBXviCp.o
a.cc:(.text+0x136): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/ccBXviCp.o
a.cc:(.text+0x156): relocation truncated to fit: R_X86_64_PC32 against symbol `w' defined in .bss section in /tmp/ccBXviCp.o
collect2: error: ld returned 1 exit status
Language: C++

#include<bits/stdc++.h>
#include <corecrt_memcpy_s.h>
const long long INF = INT_MAX / 2;
const long long MOD = 1000000007;
const long double PI = 3.1415926;
#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--)
#define REP(i,n) FOR(i,0,n)
#define REP1(i,n) FOR(i,1,n+1)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define RALL(x) x.rbegin(),x.rend()
#define ll long long int
using namespace std;
//ll n, k, ans = 0, sum = 0, cnt = 0;
//string s;
//vector<ll> v;
//vector<ll> v1;
//vector < pair<ll, ll > > vp;
//vector<vector<ll> > vv(50, vector<ll>(50, INF));
//vector<string> vs;
//vector<char> vc;
//set<ll> st;
//map<char, ll> mp;

/*--------------------template--------------------*/

#include<iostream>
#include<vector>
#define MAX 100
#define DIAGONAL 1
#define LEFT 0

struct Item {
	int value, weight;
};

int n;
Item items[MAX];
int C[MAX + 1][MAX + 1], G[MAX + 1][MAX + 1];
int weight;

void compute(int &maxValue, vector<int> &path) {
	for (int w = 0; w <= weight; w++) {
		C[0][w] = 0;
		G[0][w] = DIAGONAL;
	}

	for (int i = 1; i <= n; i++) C[i][0] = 0;

	for (int i = 1; i <= n; i++) {
		for (int w = 1; w <= weight; w++) {
			if (items[i].weight <= w) {
				if (items[i].value + C[i - 1][w - items[i].weight] > C[i - 1][w]) {
					C[i][w] = items[i].value + C[i - 1][w - items[i].weight];
					G[i][w] = DIAGONAL;
				} else {
					C[i][w] = C[i - 1][w];
					G[i][w] = LEFT;
				}
			} else {
				C[i][w] = C[i - 1][w];
				G[i][w] = LEFT;
			}
		}
	}

	maxValue = C[n][weight];

	path.clear();
	int w = weight;

	for (int i = n; i >= 1; i--) {
		if (G[i][w] == DIAGONAL) {
			path.push_back(i);
			w -= items[i].weight;
		}
	}

	reverse(path.begin(), path.end());
}

void input() {
	cin >> n >> weight;
	for (int i = 1; i <= n; i++) {
		cin >> items[i].weight >> items[i].value;
	}
}

int main() {
	int maxValue;
	vector<int> path;
	input();
	compute(maxValue, path);

	cout << maxValue << endl;
}

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

#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
#define DEBUG(X) cerr<<__LINE__<<" "<<#X<<": "<<X<<endl;
#define sci(x) int x;scanf("%d",&x);
#define scii(x, y) int x,y;scanf("%d%d",&x,&y);
#define REP(i, y) for(int i=0;i<y;i++)

const int MAX_N = 110;
const int MAX_W = 1e9+10;

int dp[MAX_N][MAX_W];
int w[MAX_N];
int v[MAX_N];

int main() {
  scii(N, W)
  REP(i,N) {
    scanf("%d%d",&w[i], &v[i]);
  }

  REP(i, N+1) {
    REP(c, W+1) {
      if (i==0||c==0)
        dp[i][c] = 0;
      else if (c >= w[i-1]) {
        dp[i][c] = max(v[i-1] + dp[i-1][c-w[i-1]], dp[i-1][c]);
      } else {
        dp[i][c] = dp[i-1][c];
      }
    }
  }
  printf("%d\n", dp[N][W]);
}

Compiler output:
/tmp/cclEJStv.o: in function `main':
a.cc:(.text+0x40): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/cclEJStv.o
a.cc:(.text+0x57): relocation truncated to fit: R_X86_64_PC32 against symbol `w' defined in .bss section in /tmp/cclEJStv.o
a.cc:(.text+0xe8): relocation truncated to fit: R_X86_64_PC32 against symbol `w' defined in .bss section in /tmp/cclEJStv.o
a.cc:(.text+0x136): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/cclEJStv.o
a.cc:(.text+0x156): relocation truncated to fit: R_X86_64_PC32 against symbol `w' defined in .bss section in /tmp/cclEJStv.o
collect2: error: ld returned 1 exit status
Language: Java

import java.util.Scanner;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int T = sc.nextInt();
        int t[] = new int[N];
        int total = 0;
        for(int i = 0; i <t.length; ++i){
            t[i] = sc.nextInt();
        }
        for(int i = 0; i <t.length; ++i){
            int num1 = t[i+1] - t[i];
        }
        total = Math.min(T, num1);
        System.out.println(total);
    }
}

Compiler output:
Main.java:16: error: cannot find symbol
        total = Math.min(T, num1);
                            ^
  symbol:   variable num1
  location: class Main
1 error
Language: Java

public class Main {
    public static void main(String[] args) throws Exception {
        //値の取得
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long T = sc.nextLong();
        long[] t = new long[N];
        for (int i = 0; i < N; ++i){
            t[i] = sc.nextLong();
        }
        
        long X = 0; //総和
        
        for (int i = 0; i < N-1; ++i){
            X += Math.min(T,t[i+1]-t[i]);   //t[i+1]-t[i]：次の人が来るまでの時間
        }
        
        X += T; //最後にTを加える
        
        System.out.println(X);
        
    }
}

Compiler output:
Main.java:4: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
                         ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

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

int main() {
  long long n,t;
  cin>>n>>t;
  vector<long long>a(n);
  for(int i=0;i<n;i++) cin>>a[i];
  long long ans=t;
  for(int i=0;i<n-1;i++){
    if(a[i+1]-a[i]>k) ans+=k;
    else ans+=a[i+1]-a[i];
  }
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:20: error: 'k' was not declared in this scope
   11 |     if(a[i+1]-a[i]>k) ans+=k;
      |                    ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n,t;
    cin >> n >> t;

    vector<int> ti(i);
    for (int i = 0; i < n; i++)
    {
        cin >> ti[i];
    }
    
    int ans = t;
    for (int i = 1; i < n - 1; i++)
    {
            ans += min(ti[i] - ti[i - 1],t);
    }
    
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:20: error: 'i' was not declared in this scope; did you mean 'ti'?
    8 |     vector<int> ti(i);
      |                    ^
      |                    ti
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for (int (i) = 0; (i) < (int)(n); i++) 
#define FOR(i, a, b) for(int (i) = a; (i) < (int)b; i++)
#define RREP(i, n) for(int (i)=((int)(n)-1); (i)>=0; i--)
#define RFOR(i, a, b) for(int (i) =((int)(b)-1); (i)>=(int)a; i--)
#define ALL(v) (v).begin(),(v).end()
#define MOD 1000000007
#define NIL -1
#define FI first
#define SE second
#define MP make_pair
#define PB push_back
#define SZ(x)  (int)x.size()
#define SP(x)  setprecision((int)x)


using namespace std ;
typedef long long ll;
typedef vector<int> vint;
typedef vector<vint> vvint;
typedef vector<string> vstr;
typedef pair<int, int> pii;
const int INF = 1e9;
const ll LINF = 1e18;
const double EPS = 1e-9;
ll gcd(ll a, ll b) {return b ? gcd(b, a % b) : a;} //最大公約数
ll lcm(ll a, ll b) {return a / gcd(a, b) * b;} //最小公倍数

//-------------------------------------------------
// 
void yes(){
  cout <<"Yes"<<endl ;
}
void no(){
  cout <<"No"<<endl ;
}


//-------------------------------------------------
// メモ




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


int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n ;
  cin >> n ;
  ll t ;
  cin >> t ;
  vector<ll> tim(n) ;
  ll ans = 10 ;
  REP(i,n){
    cin >> tim.at(i) ;
  }
  REP(i,n){
    if(i!=0){
      if(tim.at(i)<=t+t.at(i-1)){
        ans += t.at(i)-t.at(i-1) ;
      }
      else{
        ans += t ;
      }
    }
  }
  
  cout <<ans <<endl ;
      
  
  
  
  
  
  return 0 ;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:63:25: error: request for member 'at' in 't', which is of non-class type 'll' {aka 'long long int'}
   63 |       if(tim.at(i)<=t+t.at(i-1)){
      |                         ^~
a.cc:64:18: error: request for member 'at' in 't', which is of non-class type 'll' {aka 'long long int'}
   64 |         ans += t.at(i)-t.at(i-1) ;
      |                  ^~
a.cc:64:26: error: request for member 'at' in 't', which is of non-class type 'll' {aka 'long long int'}
   64 |         ans += t.at(i)-t.at(i-1) ;
      |                          ^~
Language: C++

#include<bits/stdc++.h>
#include <iostream>
#include <string>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
int main(){
  ll n,t;
  cin>>n>>t;
  vll a(n);
  ll ans=0;
  rep(i,n) cin>>a[i];
  fpr(int i=1;i<n;i++){
    if(a[i]-a[i-1]<t){
      ans+=a[i]-a[i-1];
    }
    else{
      ans+=t;
    }
  }
  ans+=t;
  COUT(ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:7: error: expected primary-expression before 'int'
   39 |   fpr(int i=1;i<n;i++){
      |       ^~~
a.cc:39:15: error: 'i' was not declared in this scope
   39 |   fpr(int i=1;i<n;i++){
      |               ^
Language: Java

import java.util.*;
 
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N=sc.nextInt();
    int T=sc.nextInt();
    int[] t=new int[N];
    int ans = 0;
    
    for(int i=0;i<N;i++){
      t[i]=sc.nextInt();
    }
 
    if(N > 1){
      ans = t[1] - t[0];
    }else{
      ans = T;
      System.out.println(ans);
      break;
    }
    for(int j=1;j<N;j++){
      if(T <(t[j+1] - t[j])){
        ans += (t[j+1] - t[j]);
      }else{
        ans += T;
      }
    }
    ans += T;

    System.out.println(ans);
  }
}

Compiler output:
Main.java:20: error: break outside switch or loop
      break;
      ^
1 error
Language: Java

import java.util.*;
 
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N=sc.nextInt();
    int T=sc.nextInt();
    int[] t=new int[N];
    int ans = T;
    
    for(int i=0;i<N;i++){
      t[i]=sc.nextInt();
    }
 
    for(int j=1;j<n;j++){
      if(T <(t[j] - t[j-1])){
        ans += t[j] - t[j-1];
      }else{
        ans += T;
      }
      
    }

    System.out.println(ans);
  }
}

Compiler output:
Main.java:15: error: cannot find symbol
    for(int j=1;j<n;j++){
                  ^
  symbol:   variable n
  location: class Main
1 error
Language: C++

#include <iostream>
#include "cstdio"
using namespace std;
const int maxn = 200005;
int n, tx[maxn];
int clk, cur;
int sum, u, t;
int main() 
{
	scanf("%d %d", &n, &t);
	clk = 0;cur = 0;
	for(int i = 1; i <= n; i++)
	{
		scanf("%d", &tx[i]);
	}
	sort(tx+1, tx+1+n);
	long long ans = 0;
	for(int i = 1; i <= n; i++)
	{
		ans += tx[i] + t - max(tx[i], cur);
		cur = tx[i] + t;
	}
	
	/*	if(u - cur > t || cur == 0)	clk = 0;
		else 						clk = 1;
		
		if(clk)	
			sum += u - cur;
		else
			sum += t;
		cur = u;
	*/
	cout << ans << endl;
	return 0;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   16 |         sort(tx+1, tx+1+n);
      |         ^~~~
      |         short
Language: C++

#include<cstdio>
#include<algorithm>
using namespace std;
const int maxn=2e6+5;
long long a[maxn];
int main()
{
	int n;
	long long m;
	scanf("%d %lld",&n,&t);
	for(int i=1;i<=n;i++){
		scanf("%lld",&a[i]);
	}
	long long x=0;
	for(int i=2;i<=n;i++){
		if(a[i]-a[i-1]<t)
			x=x+a[i]-a[i-1];
		else
			x=x+t;
	}
	x=x+t;
	printf("%lld\n",x);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:29: error: 't' was not declared in this scope
   10 |         scanf("%d %lld",&n,&t);
      |                             ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int n,w;
int arr[100][2];
int dp[100][101][300];
int w1;
int get(int cur,int num,int a){
if(cur==n)return 0;
if(dp[cur][num][a]>=0) return dp[cur][num][a];
int remain=w-w1*num-a;
int res=get(cur+1,num,a);
if(remain>=arr[cur][0])
    res=max(res,arr[cur][1]+get(cur+1,num+1,a+(arr[cur][0]-w1)));
return dp[cur][num][a]=res;
}
int main(void){
cin >> n >> w;
for(int i=0;i<n;i++)
    cin >> arr[i][0] >> arr[i][1];
 w1=arr[i][0];
memset(dp,-1,sizeof(dp));
cout <<get(0,0,0);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: 'i' was not declared in this scope
   20 |  w1=arr[i][0];
      |         ^
Language: C++

a,b = map(int,input().split())
ls = list(map(int, input().split()))

duration = 0 
max = 0

for i in ls :
  if  i <= max and max <= i+b :	
    duration += i + b - max  
    max = i + b
    
  elif max < i :
    duration += b
    max = i + b
    
print(duration)    

Compiler output:
a.cc:1:1: error: 'a' does not name a type
    1 | a,b = map(int,input().split())
      | ^
Language: C

s,t,p,T;main(i){for(;~scanf("%d",&t);i--?(s+=t-p>T?T:t-p,p=t):T=t);printf("%d",s+T);}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | s,t,p,T;main(i){for(;~scanf("%d",&t);i--?(s+=t-p>T?T:t-p,p=t):T=t);printf("%d",s+T);}
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 's' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 't' [-Wimplicit-int]
    1 | s,t,p,T;main(i){for(;~scanf("%d",&t);i--?(s+=t-p>T?T:t-p,p=t):T=t);printf("%d",s+T);}
      |   ^
main.c:1:5: error: type defaults to 'int' in declaration of 'p' [-Wimplicit-int]
    1 | s,t,p,T;main(i){for(;~scanf("%d",&t);i--?(s+=t-p>T?T:t-p,p=t):T=t);printf("%d",s+T);}
      |     ^
main.c:1:7: error: type defaults to 'int' in declaration of 'T' [-Wimplicit-int]
    1 | s,t,p,T;main(i){for(;~scanf("%d",&t);i--?(s+=t-p>T?T:t-p,p=t):T=t);printf("%d",s+T);}
      |       ^
main.c:1:9: error: return type defaults to 'int' [-Wimplicit-int]
    1 | s,t,p,T;main(i){for(;~scanf("%d",&t);i--?(s+=t-p>T?T:t-p,p=t):T=t);printf("%d",s+T);}
      |         ^~~~
main.c: In function 'main':
main.c:1:9: error: type of 'i' defaults to 'int' [-Wimplicit-int]
main.c:1:23: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    1 | s,t,p,T;main(i){for(;~scanf("%d",&t);i--?(s+=t-p>T?T:t-p,p=t):T=t);printf("%d",s+T);}
      |                       ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | s,t,p,T;main(i){for(;~scanf("%d",&t);i--?(s+=t-p>T?T:t-p,p=t):T=t);printf("%d",s+T);}
main.c:1:23: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    1 | s,t,p,T;main(i){for(;~scanf("%d",&t);i--?(s+=t-p>T?T:t-p,p=t):T=t);printf("%d",s+T);}
      |                       ^~~~~
main.c:1:23: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:64: error: lvalue required as left operand of assignment
    1 | s,t,p,T;main(i){for(;~scanf("%d",&t);i--?(s+=t-p>T?T:t-p,p=t):T=t);printf("%d",s+T);}
      |                                                                ^
main.c:1:68: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    1 | s,t,p,T;main(i){for(;~scanf("%d",&t);i--?(s+=t-p>T?T:t-p,p=t):T=t);printf("%d",s+T);}
      |                                                                    ^~~~~~
main.c:1:68: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:68: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:68: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

s,t,p,T;main(i){for(;~scanf("%d",&t);i--?s+=t-p>T?T:t-p,p=t:T=t);printf("%d",s+T);}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | s,t,p,T;main(i){for(;~scanf("%d",&t);i--?s+=t-p>T?T:t-p,p=t:T=t);printf("%d",s+T);}
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 's' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 't' [-Wimplicit-int]
    1 | s,t,p,T;main(i){for(;~scanf("%d",&t);i--?s+=t-p>T?T:t-p,p=t:T=t);printf("%d",s+T);}
      |   ^
main.c:1:5: error: type defaults to 'int' in declaration of 'p' [-Wimplicit-int]
    1 | s,t,p,T;main(i){for(;~scanf("%d",&t);i--?s+=t-p>T?T:t-p,p=t:T=t);printf("%d",s+T);}
      |     ^
main.c:1:7: error: type defaults to 'int' in declaration of 'T' [-Wimplicit-int]
    1 | s,t,p,T;main(i){for(;~scanf("%d",&t);i--?s+=t-p>T?T:t-p,p=t:T=t);printf("%d",s+T);}
      |       ^
main.c:1:9: error: return type defaults to 'int' [-Wimplicit-int]
    1 | s,t,p,T;main(i){for(;~scanf("%d",&t);i--?s+=t-p>T?T:t-p,p=t:T=t);printf("%d",s+T);}
      |         ^~~~
main.c: In function 'main':
main.c:1:9: error: type of 'i' defaults to 'int' [-Wimplicit-int]
main.c:1:23: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    1 | s,t,p,T;main(i){for(;~scanf("%d",&t);i--?s+=t-p>T?T:t-p,p=t:T=t);printf("%d",s+T);}
      |                       ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | s,t,p,T;main(i){for(;~scanf("%d",&t);i--?s+=t-p>T?T:t-p,p=t:T=t);printf("%d",s+T);}
main.c:1:23: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    1 | s,t,p,T;main(i){for(;~scanf("%d",&t);i--?s+=t-p>T?T:t-p,p=t:T=t);printf("%d",s+T);}
      |                       ^~~~~
main.c:1:23: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:62: error: lvalue required as left operand of assignment
    1 | s,t,p,T;main(i){for(;~scanf("%d",&t);i--?s+=t-p>T?T:t-p,p=t:T=t);printf("%d",s+T);}
      |                                                              ^
main.c:1:66: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    1 | s,t,p,T;main(i){for(;~scanf("%d",&t);i--?s+=t-p>T?T:t-p,p=t:T=t);printf("%d",s+T);}
      |                                                                  ^~~~~~
main.c:1:66: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:66: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:66: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

#include<iostream>
#include<vector>

using namespace std;

int main(){
  int N,T,sum=0;
  cin >> N >> T;
  vector(int) t(N);
  for(int i=0;i<N;i++){
    cin << t[i];
  }
  for(int j=1;j<N;j++){
    if(t[j]-t[j-1]<T){
      sum += t[j]-t[j-1];
    }else{
      sum += T;
    }
  }
}
    
      
  

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: missing template arguments before '(' token
    9 |   vector(int) t(N);
      |         ^
a.cc:9:10: error: expected primary-expression before 'int'
    9 |   vector(int) t(N);
      |          ^~~
a.cc:11:12: error: 't' was not declared in this scope
   11 |     cin << t[i];
      |            ^
a.cc:14:8: error: 't' was not declared in this scope
   14 |     if(t[j]-t[j-1]<T){
      |        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
int main(){
  ll N,T;
  cin>>N>>T;
  vll t(N);
  for (ll i=0;i<N;i++) cin>>t[i];
  ans=T;
  for (ll i=0;i<N-1;i++) {
    ll x=t[i]+T-t[i+1];
    ans += T-max((ll)0,x);
  }
  cout<<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
   10 |   ans=T;
      |   ^~~
      |   abs
Language: Java

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        long t=sc.nextInt();
        long[] nums=new long[n+1];
        for(int i=0;i<n;i++){
            nums[i]=sc.nextInt();
        }
        nums[n]=Long.MAX_VALUE;
        long output=0;
        for(int i=0;i<n;i++){
            output+=Math.min(t, nums[i+1]-nums[i]);
        }
        System.out.println(output);
    }
     
}

Compiler output:
Main.java:4: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
                         ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

#include <tuple>
#include <random>
#include <map>
#include <set>
#include <complex>
#include <algorithm>
#include <cassert>
#include <iterator>
#include <numeric>
#include <cmath>
#include <stdio.h>
#include <functional>

#define REP(i,a) for(int (i)=0;(i)<(a);i++)
#define RREP(i,a,b) for(int (i)=(a);(i)<(b);i++)
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()
#define vi vector<int> 
#define vii vector<vector<int>>
#define vll vector<ll>
typedef long long ll;
using namespace std;

int main(void){
    ll N,T,ans=0;
    vll t(N);
    cin>>N>>T;
    REP(i,N){
        cin>>t[i];
    }
    REP(i,N){
        if(i==N-1){
            ans+=T;
        }else if(t[i] + T <= t[i+1]){
            ans+=T;
        }else{
            ans += t[i+1]-t[i];
        }
    }
    cout<<ans;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:5: error: 'cin' was not declared in this scope
   27 |     cin>>N>>T;
      |     ^~~
a.cc:13:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
   12 | #include <functional>
  +++ |+#include <iostream>
   13 | 
a.cc:40:5: error: 'cout' was not declared in this scope
   40 |     cout<<ans;
      |     ^~~~
a.cc:40:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;

int main(void) {
	int num, t, ans = 0, i = 1, a, b;
	cin >> num >> t >> b;
	for (; i < num; i++) {
		scanf_s("%d", &a);
		ans += min(t, a - b);
		b = a;
	}
	cout << ans + t << "\n";
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   10 |                 scanf_s("%d", &a);
      |                 ^~~~~~~
      |                 scanf
Language: C++

#include <vector>
#include <cstdio>
#include <iostream>
#include <cmath>
#include <string>
#include <cstring>
#include <algorithm>
#include <numeric>
#include <cstdlib>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define REP(i,n) for(int i=0;i<n;i++)
#define SORT(c) sort((c).begin(),(c).end())
#define ALL(a) (a).begin(),(a).end()

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

  int n;
  ll t;
  cin >> n >> t;

  vector<ll> a(n);

  REP(i, n) {
    cin >> a[i];
  }

  ll ans = t;
  REP(i, n-1) {
    ans += t;
    if(a[i+1] - a[i] < T) ans -= t-(a[i+1] - a[i]);
  }

  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:24: error: 'T' was not declared in this scope
   35 |     if(a[i+1] - a[i] < T) ans -= t-(a[i+1] - a[i]);
      |                        ^
Language: C++

// ------------------------------------
// Date:2018/ 3/ 9
// Problem:ARC 073 Sentou c.cpp
//
// ------------------------------------

#include <bits/stdc++.h>

using namespace std;

#define EACH(i,a) for (auto&& i : a)
#define FOR(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define RFOR(i,a,b) for(int i=(int)b-1;i>=(int)a;--i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define debug(x) cerr << #x << ":" << x << endl

typedef long long ll;

static const int MOD = 1000000007;

int time[101010101];

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

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

  vector< int > t(N);
  REP(i, N) {
    cin >> t[i];
  }

  ll ans = 0ll;
  REP(i, N - 1) {
    ans = min(t[i + 1] - t[i], T);
  }

  // 最後の一回は必ずT秒出る
  ans += T;
  
  cout << ans << endl;
  
  return 0;
}



Compiler output:
a.cc:23:19: error: 'int time [101010101]' redeclared as different kind of entity
   23 | int time[101010101];
      |                   ^
In file included from /usr/include/pthread.h:23,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157,
                 from /usr/include/c++/14/ext/atomicity.h:35,
                 from /usr/include/c++/14/bits/ios_base.h:39,
                 from /usr/include/c++/14/streambuf:43,
                 from /usr/include/c++/14/bits/streambuf_iterator.h:35,
                 from /usr/include/c++/14/iterator:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54,
                 from a.cc:7:
/usr/include/time.h:76:15: note: previous declaration 'time_t time(time_t*)'
   76 | extern time_t time (time_t *__timer) __THROW;
      |               ^~~~
Language: C

#include<cstdio>
#include<cstring>
#include<iostream>
#include<map>
#include<queue>
using namespace std;

int main(){
	int a[1000];
	int n,t,i,T=0;
	scanf("%d%d",&n,&t);
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
	}
	for(i=1;i<n;i++){
		if((a[i]-a[i-1])>=t) T=T+t;
		if((a[i]-a[i-1])<t) T=T+(a[i]-a[i-1]);   	   
	}
	T=T+t;
	printf("%d\n",T);
}


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

#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	int N,i,T,X = 0,m,t[200005];
	int a = 0,dex[200005];
	scanf("%d %d",&N,&T);
	for(i = 0;i < N; i++)
		scanf("%d",&t[i]);
		dex[0] = t[0];
	for(i = 1;i < N; i++)
	{
		if(t[i] >= T + t[dex[a]])
		{  
			a++;
			dex[a] = i;
		}
	}
	if(a > 1)
	{
		for(i = 1;i <= a; i++)
		{
			if(dex[i] != dex[i - 1] + 1)
			{
				m = dex[i] - 1;
				X += t[m] + T;
			}
			else
				X + = T;   
		}
	}
	else if(a == 1)
			X = 2 * T;
		else
			X = T + t[N - 1];
			printf("%d\n",X);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:37: error: expected primary-expression before '=' token
   34 |                                 X + = T;
      |                                     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAXN=2e5+10;
int ti[MAXN];
int main(){
	ll n,t;
	while(cin>>n>>t){
		for(int i=1;i<=n;i++) cin>>t[i];
		ll sum=0;
		sum+=t;
		for(int i=2;i<=n;i++){
			if (sum>ti[i])
				sum=ti[i]+t;
			else
				sum+=t;
		}
		cout<<sum<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:45: error: invalid types 'll {aka long long int}[int]' for array subscript
    9 |                 for(int i=1;i<=n;i++) cin>>t[i];
      |                                             ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int MAXN=2e5+10;
int ti[MAXN];
int main(){
	int n,t;
	scanf("%d%d",&n,&t);
	for(int i=1;i<=n;i++) scanf("%d",&ti[i]);
	ll sum=0;
	sum+=t;
	for(int i=2;i<=n;i++){
		if (sum>ti[i])
			sum=ti[i]+t;
		else
			sum+=t;
	}
	printf("%lld\n",sum);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'll' was not declared in this scope
    9 |         ll sum=0;
      |         ^~
a.cc:10:9: error: 'sum' was not declared in this scope
   10 |         sum+=t;
      |         ^~~
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
int main() {
  int N, K;
  cin >> N >> K;
  long long prev = 0;
  long long now = 0;
  long long sum = 0;
  for(int i = 0; i < N; ++i) {
    prev = now;
    cin >> now;
    sum += min(now - prev, K);
  }
  cout << sum + K << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:15: error: no matching function for call to 'min(long long int, int&)'
   13 |     sum += min(now - prev, K);
      |            ~~~^~~~~~~~~~~~~~~
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:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:13:15: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   13 |     sum += min(now - prev, K);
      |            ~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:13:15: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   13 |     sum += min(now - prev, K);
      |            ~~~^~~~~~~~~~~~~~~
Language: C

#include <stdio.h>
#include <limits.h>
#define MAXN 200010
int t[MAXN], N, T;
int solve(void) {
    int s = 0;
    for(int i = 0; i < N; i++) s += min(t[i + 1] - t[i], T);
    return s;
}
int main(void) {
    scanf("%d%d", &N, &T);
    for(int i = 0; i < N; i++) scanf("%d", &t[i]);
    t[N] = INT_MAX;
    printf("%d", solve());
    return 0;
}

Compiler output:
main.c: In function 'solve':
main.c:7:37: error: implicit declaration of function 'min' [-Wimplicit-function-declaration]
    7 |     for(int i = 0; i < N; i++) s += min(t[i + 1] - t[i], T);
      |                                     ^~~
Language: C++

#include<bits/stdc++.h>
int main(int argc, const char * argv[])
{
    long long pNum, baseTime, tmp, total = 0, preTmp = -1;
    cin>>pNum>>baseTime;
    while(pNum > 0)
    {
        cin>>tmp;
        pNum --;
        if(preTmp == -1)
        {
            preTmp = tmp;
            continue;
        }
        if((preTmp + baseTime) <= tmp) total += baseTime;
        else total += (tmp - preTmp);
        preTmp = tmp;
    }
    total += baseTime;
    cout<< total<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:5:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |     cin>>pNum>>baseTime;
      |     ^~~
      |     std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:20:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   20 |     cout<< total<<endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:20:19: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   20 |     cout<< total<<endl;
      |                   ^~~~
      |                   std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdint>

using namespace std;

int main()
{
    int32_t n, t;
    cin >> n >> t;

    vector<int32_t> v{ n };
    for(auto& x : v) {
        cin >> x;
    }

    int64_t sum{ 0 };
    for(auto i = 1U; i < v.size(); ++i) {
        sum += min(t, v[i) - v[i - 1]);
    }

    cout << sum << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:26: error: expected ']' before ')' token
   20 |         sum += min(t, v[i) - v[i - 1]);
      |                          ^
      |                          ]
a.cc:20:38: error: expected ';' before ')' token
   20 |         sum += min(t, v[i) - v[i - 1]);
      |                                      ^
      |                                      ;
Language: C++

N, T = map(int, input().split())
t = list(map(int, input().split()))

_all = N * T
sabun = 0

for i in range(1, N):
    if T < t[i]:
        sabun += 0
    elif i == 1:
        sabun += T - t[i]
    else:
        sabun += T - (t[i] - t[i - 1])

print(_all - sabun)

Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N, T = map(int, input().split())
      | ^
Language: C++

////////////////////////////////////////////////////////////////////
// This source code is for Visual C++ 2010 Express
////////////////////////////////////////////////////////////////////
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <sstream>
#include <iterator>
#include <stack>
#include <functional>
#include <iomanip>
#include <string>
#include <cstring>
#include <deque>
#include <math.h>
#include "UnionFind.h"

#define	numberof(a)	(sizeof(a) / sizeof(a[0]))
#define	INF		(1000000)
#define Rep(i,n) for(int i = 0; i < (n); i++ )

using namespace std;

typedef vector< vector<int> > mat;
typedef pair<int, int> P;
typedef long long ll;
struct Point{
	ll x;
	ll y;
	Point() {};
	Point( ll xx, ll yy ) : x(xx), y(yy) {};
};

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

ll solve( ll N, ll T, vector<ll> & t )
{
	ll ret = 0;
	ll start_index = 0;
	ll end_index = 0;

	while(1){
		ll expired = 0;

		for( ll j = start_index; j < N; ++j ){
			expired = (t[j] - t[start_index]);
			if( expired >= T ){
				end_index = j - 1;
				break;
			}
			if( j == N - 1 ){
				end_index = N - 1;
				break;
			}
		}
		ret += t[end_index] - t[start_index] + T;

		// Next
		start_index = end_index + 1;
		if( start_index >= N ){
			break;
		}
	}

	return ret;
}

int main()
{
	ll T = 0;
	ll N = 0;
	vector<ll> t;

	cin >> N >> T;
	t.resize(N);
	Rep(i, N){
		cin >> t[i];
	}

	cout << solve(N, T, t) << endl;

	return 0;
}





Compiler output:
a.cc:21:10: fatal error: UnionFind.h: No such file or directory
   21 | #include "UnionFind.h"
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>
 
int main(){
	int i, N;
	double sum, sa, T;
	double t[1000000001];

	scanf("%d %lf", &N, &T);

	for(i = 1; i <= N; i++) {
		scanf("%lf", &t[i]);
	}

	for(i = 1; i <= N; i++) {
		sa = t[i + 1] - t[i];
		if(sa => T) {
			sum += T;
		}
		if(sa < T) {
			sum += sa;
		}
	}

	printf("%f", sum);

}

Compiler output:
main.c: In function 'main':
main.c:16:24: error: expected expression before '>' token
   16 |                 if(sa => T) {
      |                        ^
Language: C

#include <stdio.h>
 
int main(){
	int i, N;
	double sum, sa, T;
	double t[1000000001];

	scanf("%d %lf", &N, &T);

	for(i = 1; i <= N; i++) {
		scanf("%lf", &t[i]);
	}

	for(i = 1; i <= N; i++) {
		sa = t[i + 1] - t[i]
		if(sa => T) {
			sum += T;
		}
		if(sa < T) {
			sum += sa;
		}
	}

	printf("%f", sum);

}

Compiler output:
main.c: In function 'main':
main.c:15:37: error: expected ';' before 'if'
   15 |                 sa = t[i + 1] - t[i]
      |                                     ^
      |                                     ;
   16 |                 if(sa => T) {
      |                 ~~
Language: C

#include <stdio.h>
 
int main(){
	double i, sum, sa, N, T;
	double t[1000000001];

	scanf("%lf %lf", &N, &T);

	for(i = 1; i <= N; i++) {
		scanf("%lf", &t[i]);
	}

	for(i = 1; i <= N; i++) {
		sa = t[i + 1] - t[i]
		if(sa => T) {
			sum += T;
		}
		if(sa < T) {
			sum += sa;
		}
	}

	printf("%f", sum);

}

Compiler output:
main.c: In function 'main':
main.c:10:32: error: array subscript is not an integer
   10 |                 scanf("%lf", &t[i]);
      |                                ^
main.c:14:23: error: array subscript is not an integer
   14 |                 sa = t[i + 1] - t[i]
      |                       ^
main.c:14:34: error: array subscript is not an integer
   14 |                 sa = t[i + 1] - t[i]
      |                                  ^
main.c:14:37: error: expected ';' before 'if'
   14 |                 sa = t[i + 1] - t[i]
      |                                     ^
      |                                     ;
   15 |                 if(sa => T) {
      |                 ~~
Language: C

#include <stdio.h>
 
int main(){
	double i, sum, N, T;
	double t[1000000001];

	scanf("%lf %lf", &N, &T);

	for(i = 1; i <= N; i++) {
		scanf("%lf", &t[i]);
	}

	for(i = 1; i <= N; i++) {
		if((t[i + 1] - t[i]) => T) {
			sum += T;
		}
		if((t[i + 1] - t[i]) < T) {
			sum += (t[i + 1] - t[i]);
		}
	}

	printf("%f", sum);

}

Compiler output:
main.c: In function 'main':
main.c:10:32: error: array subscript is not an integer
   10 |                 scanf("%lf", &t[i]);
      |                                ^
main.c:14:22: error: array subscript is not an integer
   14 |                 if((t[i + 1] - t[i]) => T) {
      |                      ^
main.c:14:33: error: array subscript is not an integer
   14 |                 if((t[i + 1] - t[i]) => T) {
      |                                 ^
main.c:14:39: error: expected expression before '>' token
   14 |                 if((t[i + 1] - t[i]) => T) {
      |                                       ^
main.c:17:22: error: array subscript is not an integer
   17 |                 if((t[i + 1] - t[i]) < T) {
      |                      ^
main.c:17:33: error: array subscript is not an integer
   17 |                 if((t[i + 1] - t[i]) < T) {
      |                                 ^
main.c:18:34: error: array subscript is not an integer
   18 |                         sum += (t[i + 1] - t[i]);
      |                                  ^
main.c:18:45: error: array subscript is not an integer
   18 |                         sum += (t[i + 1] - t[i]);
      |                                             ^
Language: C++

import java.util.*;
import java.io.*;

public class Main {
	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int T = sc.nextInt();
        final int INF = 2000000000;
        
        int[] start = new int[N+1];
        int[] end = new int[N+1];
        for(int i=0;i<N;i++){
        		start[i]=sc.nextInt();
        		end[i] = start[i]+T;
        }
        start[N]=INF;
        end[N]=INF;//avoid AIOOBException
        
        int s=0;
        int e=0;
        int time=0;
        int water=0;
        int ans=0;
        while(e<N){
        	if(start[s]==end[e]){
        		if(water>0){
        			ans += (start[s]-time);
        		}
        		time = start[s];
        		s++;
        		e++;
        	}else if(start[s]>end[e]){//end
        		if(water>0){
        			ans += (end[e]-time);
        		}
        		water--;
        		time = end[e];
        		e++;
        	}else{//start[s]<end[e] //start
        		if(water>0){
        			ans += (start[s]-time);
        		}
        		water++;
        		time = start[s];
        		s++;
        	}
        }
        
        System.out.println(ans);
    }
}

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: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:4:1: error: expected unqualified-id before 'public'
    4 | public class Main {
      | ^~~~~~
Language: C

#include <stdio.h>
 
int main(){
	double i, sum, N, T;
	double t[1000000001];

	scanf("%lf %lf", N, T);

	for(i = 1; i <= N; i++) {
		scanf("%lf", t[i]);
	}

	for(i = 1; i <= N; i++) {
		if((t[i + 1] - t[i]) => T) {
			sum += T;
		}
		if((t[i + 1] - t[i]) < T) {
			sum += (t[i + 1] - t[i]);
		}
	}

	printf("%f", sum);

}

Compiler output:
main.c: In function 'main':
main.c:10:31: error: array subscript is not an integer
   10 |                 scanf("%lf", t[i]);
      |                               ^
main.c:14:22: error: array subscript is not an integer
   14 |                 if((t[i + 1] - t[i]) => T) {
      |                      ^
main.c:14:33: error: array subscript is not an integer
   14 |                 if((t[i + 1] - t[i]) => T) {
      |                                 ^
main.c:14:39: error: expected expression before '>' token
   14 |                 if((t[i + 1] - t[i]) => T) {
      |                                       ^
main.c:17:22: error: array subscript is not an integer
   17 |                 if((t[i + 1] - t[i]) < T) {
      |                      ^
main.c:17:33: error: array subscript is not an integer
   17 |                 if((t[i + 1] - t[i]) < T) {
      |                                 ^
main.c:18:34: error: array subscript is not an integer
   18 |                         sum += (t[i + 1] - t[i]);
      |                                  ^
main.c:18:45: error: array subscript is not an integer
   18 |                         sum += (t[i + 1] - t[i]);
      |                                             ^
Language: C++

#include<bits/stdc++.h>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<algorithm>
using namespace std;

int main(){
    int N,
    long long W,v,w;
    scanf("%d %lld",&N,&W);
//制限の重さWまでのdpテーブルを用意して0埋めする
    vector<int> dp(W+1);
    fill(dp.begin(), dp.end(), 0);
//入力を受け取りながら受け取った荷物の重さのとこを確認
    for(int i=0;i<N;i++){
        scanf("%lld %lld",&v,&w);
        dp[w]=max(dp[w],v);
//よくわからない
        for(int j=0;j<W-w+1;j++){
            if(dp[j]!=0){
                dp[j+w]=max(dp[j+w],dp[j]+v);
            }
        }
    }
//dpテーブルの最大値を出力
    printf("%d\n",*max_element(dp.begin(),dp.end()));
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: expected unqualified-id before 'long'
   11 |     long long W,v,w;
      |     ^~~~
a.cc:12:25: error: 'W' was not declared in this scope
   12 |     scanf("%d %lld",&N,&W);
      |                         ^
a.cc:18:28: error: 'v' was not declared in this scope
   18 |         scanf("%lld %lld",&v,&w);
      |                            ^
a.cc:18:31: error: 'w' was not declared in this scope
   18 |         scanf("%lld %lld",&v,&w);
      |                               ^
Language: C++

import java.util.*;

public class Main {
    //-------------------------------------------------------------//
    public static final void main(String[] args) { new Main().solve(); }
    //-------------------------------------------------------------//
    Scanner sc = new Scanner(System.in);
    void solve() {
        int N = sc.nextInt();
        int T = sc.nextInt();
        int[] t = new int[N];
        for (int i = 0; i < N; i++) t[i] = sc.nextInt();
        int ans = N * T;
        for (int i = 0; i < N - 1; i++) {
            int d = t[i + 1] - t[i];
            if (d >= T) continue;
            ans -= T - d;
        }
        System.out.println(ans);
    }
}


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:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: Java

import java.io.BufferedInputStream;
import java.util.Scanner;

public class C {

	// 14:02-
	public static void main(String[] args) {
		Scanner sc = new Scanner(new BufferedInputStream(System.in));
		int n = sc.nextInt();
		int t = sc.nextInt();
		long sum = 0L;
		long until = 0L;
		for (int i = 0; i < n; i++) {
			int x = sc.nextInt();
			sum -= Math.max(until - x, 0);
			sum += t;
			until = x + t;
		}
		System.out.println(sum);
	}
}


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