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

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

int main() {
  int n;
  scanf("%d\n", n);
  int a[n];
  scanf("%d\n", a[0]);
  int n2 = n - 1;
  int i = 1;
  int x;
  while(n2--){
    scanf("%d\n", a[i++]);
    x = strcmp(a[i], a[i+1])
    if(x)
      sum += x;
  }
  printf("%d\n", sum);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:15:17: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion]
   15 |     x = strcmp(a[i], a[i+1])
      |                ~^~~
      |                 |
      |                 int
In file included from main.c:3:
/usr/include/string.h:156:32: note: expected 'const char *' but argument is of type 'int'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
main.c:15:23: error: passing argument 2 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion]
   15 |     x = strcmp(a[i], a[i+1])
      |                      ~^~~~~
      |                       |
      |                       int
/usr/include/string.h:156:50: note: expected 'const char *' but argument is of type 'int'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                                      ~~~~~~~~~~~~^~~~
main.c:15:29: error: expected ';' before 'if'
   15 |     x = strcmp(a[i], a[i+1])
      |                             ^
      |                             ;
   16 |     if(x)
      |     ~~                       
main.c:19:18: error: 'sum' undeclared (first use in this function)
   19 |   printf("%d\n", sum);
      |                  ^~~
main.c:19:18: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <bits/stdc++.h>

using namespace std;

typedef long long LL;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = N; i >= 0; i--)

template<typename Container>
bool include(const Container& c, const typename Container::value_type& v) {
  return ( c.end() != std::find(c.begin(),c.end(),v) );
}

template<class T>
vector<T> unique_vec(const vector<T> &v) {
  sort(v.begin(), v.end());
  v.erase(unique(v.begin(), v.end()), v.end());
  return v;
}

int main() {
  LL N;
  cin >> N;
  vector<LL> A(N);
  rep(i, N)
    cin >> A[i];

  LL s = 0;
  rep(i, N-1) {
    LL d = A[i+1] - A[i];
    // cout << d << endl;
    if (d < 0) {
      s += abs(d);
      A[i+1] += abs(d);
      // cout << s << endl;
    }
  }
  cout << s << endl;

  return 0;
}


Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

/********   All Required Header Files ********/
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
using namespace std;
// ****  All Required define Pre-Processors and typedef Constants *******/
#define mem(a, b) memset(a, (b), sizeof(a))
#define FOR(i, j, k, in) for (int i=j ; i<k ; i+=in)
#define RFOR(i, j, k, in) for (int i=j ; i>=k ; i-=in)
#define fl(i, j) FOR(i, 0, j, 1)
#define RREP(i, j) RFOR(i, j, 0, 1)

#define fi(it, l) for (auto it = l.begin(); it != l.end(); it++)

#define PB push_back
#define INF (int)1e9
#define EPS 1e-9
#define PI 3.1415926535897932384626433832795
#define MOD 1000000007
const double pi=acos(-1.0);
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<PII> VII;
typedef vector<VI> VVI;
typedef map<int,int> dmap;
typedef set<int> dset;
typedef long int int32;
typedef unsigned long int uint32;
typedef long long int int64;
typedef unsigned long long int  uint64;
/********** solver function **********/
int sum=0;
void solve(vector<int> &v, int start, int end){
    if( start<0 || end<0) return;
	if( start>= end) return;
    //cout<<" start"<<start<<" end"<<end<<endl;
    int m=INT_MIN;int index=0;
    for( int i=start;i<=end;i++){
            if( v[i]>m) {m=v[i]; index=i;}
    }
    for( int i=index; i<end+1;i++){
      //  cout<<sum<<" ";
        sum=sum+( m-v[i]);
    }
    solve( v, start, index-1);
}
/********** Main()  function **********/
int main()
{
     std::ios::sync_with_stdio(false);
	int n;
    cin>>n;sum=0;
    vector<int > v;
    for( int i=0; i<n; i++){
            int x;
            cin>>x;
            v.push_back(x);
    }
    solve( v, 0, n-1);
    cout<<sum<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'void solve(std::vector<int>&, int, int)':
a.cc:58:11: error: 'INT_MIN' was not declared in this scope
   58 |     int m=INT_MIN;int index=0;
      |           ^~~~~~~
a.cc:25:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   24 | #include <assert.h>
  +++ |+#include <climits>
   25 | using namespace std;
Language: C++

#include <iostream>
using namespace std;

int main(){
 int n = 0, num = 0, cnt = 0;
 cin >> n;
 int arr[n];
 while(cnt--){
   cin>>arr[cnt];
   ++cnt;
 }
 int prev = arr[0]
 int ans = 0;
 for(int i = 1; i < sizeof(arr)/sizeof(arr[0]); ++i){
  	 if(prev<=arr[i]){
       ans++;
     }
 }
 cout<<ans;
 return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:2: error: expected ',' or ';' before 'int'
   13 |  int ans = 0;
      |  ^~~
a.cc:16:8: error: 'ans' was not declared in this scope; did you mean 'abs'?
   16 |        ans++;
      |        ^~~
      |        abs
a.cc:19:8: error: 'ans' was not declared in this scope; did you mean 'abs'?
   19 |  cout<<ans;
      |        ^~~
      |        abs
Language: C++

/********   All Required Header Files ********/
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
using namespace std;
// ****  All Required define Pre-Processors and typedef Constants *******/
#define mem(a, b) memset(a, (b), sizeof(a))
#define FOR(i, j, k, in) for (int i=j ; i<k ; i+=in)
#define RFOR(i, j, k, in) for (int i=j ; i>=k ; i-=in)
#define fl(i, j) FOR(i, 0, j, 1)
#define RREP(i, j) RFOR(i, j, 0, 1)

#define fi(it, l) for (auto it = l.begin(); it != l.end(); it++)

#define PB push_back
#define INF (int)1e9
#define EPS 1e-9
#define PI 3.1415926535897932384626433832795
#define MOD 1000000007
const double pi=acos(-1.0);
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<PII> VII;
typedef vector<VI> VVI;
typedef map<int,int> dmap;
typedef set<int> dset;
typedef long int int32;
typedef unsigned long int uint32;
typedef long long int int64;
typedef unsigned long long int  uint64;
/********** solver function **********/
int sum=0;
void solve(vector<int> &v, int start, int end){
    if( start<0 || end<0) return;
	if( start>= end) return;
    //cout<<" start"<<start<<" end"<<end<<endl;
    int m=INT_MIN;int index=0;
    for( int i=start;i<=end;i++){
            if( v[i]>m) {m=v[i]; index=i;}
    }
    for( int i=index; i<end+1;i++){
      //  cout<<sum<<" ";
        sum=sum+( m-v[i]);
    }
    solve( v, start, index-1);
}
/********** Main()  function **********/
int main()
{
    
	int n;
    cin>>n;sum=0;
    vector<int > v;
    for( int i=0; i<n; i++){
            int x;
            cin>>x;
            v.push_back(x);
    }
    solve( v, 0, n-1);
    cout<<sum<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'void solve(std::vector<int>&, int, int)':
a.cc:58:11: error: 'INT_MIN' was not declared in this scope
   58 |     int m=INT_MIN;int index=0;
      |           ^~~~~~~
a.cc:25:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   24 | #include <assert.h>
  +++ |+#include <climits>
   25 | using namespace std;
Language: C++

/********   All Required Header Files ********/
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
using namespace std;
// ****  All Required define Pre-Processors and typedef Constants *******/
#define mem(a, b) memset(a, (b), sizeof(a))
#define FOR(i, j, k, in) for (int i=j ; i<k ; i+=in)
#define RFOR(i, j, k, in) for (int i=j ; i>=k ; i-=in)
#define fl(i, j) FOR(i, 0, j, 1)
#define RREP(i, j) RFOR(i, j, 0, 1)

#define fi(it, l) for (auto it = l.begin(); it != l.end(); it++)

#define PB push_back
#define INF (int)1e9
#define EPS 1e-9
#define PI 3.1415926535897932384626433832795
#define MOD 1000000007
const double pi=acos(-1.0);
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<PII> VII;
typedef vector<VI> VVI;
typedef map<int,int> dmap;
typedef set<int> dset;
typedef long int int32;
typedef unsigned long int uint32;
typedef long long int int64;
typedef unsigned long long int  uint64;
/********** solver function **********/
int sum=0;
void solve(vector<int> v, int start, int end){
    if( start<0 || end<0) return;
	if( start>= end) return;
    //cout<<" start"<<start<<" end"<<end<<endl;
    int m=INT_MIN;int index=0;
    for( int i=start;i<=end;i++){
            if( v[i]>m) {m=v[i]; index=i;}
    }
    for( int i=index; i<end+1;i++){
      //  cout<<sum<<" ";
        sum=sum+( m-v[i]);
    }
    solve( v, start, index-1);
}
/********** Main()  function **********/
int main()
{
	int n;
    cin>>n;sum=0;
    vector<int > v;
    for( int i=0; i<n; i++){
            int x;
            cin>>x;
            v.push_back(x);
    }
    solve( v, 0, n-1);
    cout<<sum<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'void solve(std::vector<int>, int, int)':
a.cc:58:11: error: 'INT_MIN' was not declared in this scope
   58 |     int m=INT_MIN;int index=0;
      |           ^~~~~~~
a.cc:25:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   24 | #include <assert.h>
  +++ |+#include <climits>
   25 | using namespace std;
Language: C++

#include<bits/stdc++.h>
using namespace std;
int a[100002];
int main(){
	int i,n,ans=0,n;
	cin>>n;
	for(i=1;i<=n;i++)cin>>a[n];
	n=a[1];
	for(i=1;i<=n;i++){
		if(a[i]<n){
			ans+=n-a[i];
			a[i]=n;
		}
		if(a[i]>n)n=a[i];
	}
	cout<<ans;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:23: error: redeclaration of 'int n'
    5 |         int i,n,ans=0,n;
      |                       ^
a.cc:5:15: note: 'int n' previously declared here
    5 |         int i,n,ans=0,n;
      |               ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
main()
{
  long long int  h;
  cin>>h;
long long int a[h],k[h];
  for(long long int i=0;i<h;i++)
  {cin>>a[i];
   k[i]=a[i];
  }
  for(long long int i=0;i<h-1;i++)
  {if(a[i]>a[i+1])
   a[i+1]=a[i+1]+(a[i]-a[i+1]);
  }
  long long intc=0;
  for(long long int i=0;i<h;i++)
  {
       if(a[i]!=k[i])
           {c=c+1;}
  }
  if(k[0]==k[1])
        c=c-1;
  cout<<c+1;
}


Compiler output:
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:20:13: error: 'c' was not declared in this scope
   20 |            {c=c+1;}
      |             ^
a.cc:23:9: error: 'c' was not declared in this scope
   23 |         c=c-1;
      |         ^
a.cc:24:9: error: 'c' was not declared in this scope
   24 |   cout<<c+1;
      |         ^
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main(){
  int n:
  cin >> n;
  vector<int> a(n);
  for(int i = 0; i < n; i++){
    cin >> a[i];
  }
  int ans = 0;
  for(int i = 0; i < n-1; i++){
    if(a[i] > a[i+1]){
      ans = ans + a[i] - a[i+1];
      a[i+1] = a[i];
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:8: error: found ':' in nested-name-specifier, expected '::'
    5 |   int n:
      |        ^
      |        ::
a.cc:5:7: error: 'n' has not been declared
    5 |   int n:
      |       ^
a.cc:6:7: error: qualified-id in declaration before '>>' token
    6 |   cin >> n;
      |       ^~
a.cc:7:17: error: 'n' was not declared in this scope
    7 |   vector<int> a(n);
      |                 ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  vector<int> v(N);
  for(int i = 0;i < N; i++){
    cin >> v.at(i);}
  int ans = 0;
  for(int i=; i<N; i++){
    while(v.at(i) > v.at(i+1)){
      v.at(i+1) += 1;
      ans++;}
  }
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: expected primary-expression before ';' token
   10 |   for(int i=; i<N; i++){
      |             ^
Language: Java

import java.util.Scanner;

public class Step {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int num = sc.nextInt();
		int[] intArray = new int[num];

		for(int i = 0; i < num; i++)
		{
			intArray[i] = sc.nextInt();
		}

		int humidai = 0;
		int targetNum = 0;
		for(int i = 0; i < num; i++)
		{
			if(targetNum < intArray[i]) {
				targetNum = intArray[i];
				continue;
			}

			humidai += targetNum - intArray[i];
		}

		System.out.print(humidai);
	}
}

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

#include<iostream>
#include<vector>
using namespace std;
int main(){
  int n:
  cin >> n;
  vector<int> a(n);
  for(int i = 0; i < n; i++){
    cin >> a[i];
  }
  int ans = 0;
  for(int i = 0; i < n; i++){
    if(a[i] > a[i+1]){
      ans = ans + a[i] - a[i+1];
      a[i+1] = a[i];
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:8: error: found ':' in nested-name-specifier, expected '::'
    5 |   int n:
      |        ^
      |        ::
a.cc:5:7: error: 'n' has not been declared
    5 |   int n:
      |       ^
a.cc:6:7: error: qualified-id in declaration before '>>' token
    6 |   cin >> n;
      |       ^~
a.cc:7:17: error: 'n' was not declared in this scope
    7 |   vector<int> a(n);
      |                 ^
Language: C++

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

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

	vector<int> tall(N);
	for(int i=0; i<N; i++) {
		cin >> tall.at(i);
	}

	vector<int> step(N, 0);

	while(1) {
		bool flag = true;
		vector<int> tarray = tall;
		for(int i=0; i<N; i++) {
			tarray.at(i) += step.at(i);
		}

		for(int i=0; i<N - 1; i++) {
			if(tarray.at(i) > tarray.at(i + 1)) {
				flag = false;
				int gap;
				gap = tarray.at(i + 1) - tarray.at(i);
				step.at(i1) += gap;
			}
		}

		if(flag) {
			break;
		}
	}

	int sum = 0;
	for(int i=0; i<N; i++) {
		sum += step.at(i);
	}

	cout << sum << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:41: error: 'i1' was not declared in this scope; did you mean 'i'?
   27 |                                 step.at(i1) += gap;
      |                                         ^~
      |                                         i
Language: C

#include<iostream>
using namespace std;
int main()
{
 int stool=0;
long N,i;
cin>>N;
long long A[N];
for(i=0;i<N;i++)
cin>>A[i];
for(i=1;i<N;i++)
{
if(A[i]>=A[i-1]);
else
{
 stool=stool+A[i-1]-A[i];
A[i]=A[i-1];
}
}
cout<<stool;
 }

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

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

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

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

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

int main() {
  
  int N;
  cin >> N;
  
  vector<int> vec;
  
  for(int i=0; i<N; i++){
  cin >> vec.at(i);
  }
  int sum=0;
  int a=vec.at(0);
  
  for(int j=0; j<N; j++){
    if(vec.at(j)>=a){
      a=vec.at(j);
    }
    else{
      sum+=(a-vec.at(j))
    }
    
  }
  
 
  
  cout << sum<<endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:25: error: expected ';' before '}' token
   22 |       sum+=(a-vec.at(j))
      |                         ^
      |                         ;
   23 |     }
      |     ~
Language: C++

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

int main() {
  
  int N;
  cin >> N;
  
  vector<int> vec;
  
  for(int i=0; i<N; i++){
  cin >> vec.at(i);
  }
  int sum=0;
  int a=vec.at(0);
  
  for(int j=0; j<N; j++){
    if(vec.at(j)>=a){
      a=vec.at(j);
    }
    else{
      sum+=(a-vec.at(i))
    }
    
  }
  
 
  
  cout << sum<<endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:22: error: 'i' was not declared in this scope
   22 |       sum+=(a-vec.at(i))
      |                      ^
Language: C++

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

int main() {
  	longlong N, c, d;
  	longlong count = 0;
  	cin >> N;
    vector<int> vec(N);
  	for (int i = 0; i < N; i++) {
          cin >> vec[i];
    }
  	for (i = 0; i < N-1 ; i++) {
      	c = vec[i];
        d = vec[i+1];
		while (c > d) {
          	d++;
          	count++;
        }
        vec[i+1] = d;
        
    }
    cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'longlong' was not declared in this scope
    6 |         longlong N, c, d;
      |         ^~~~~~~~
a.cc:7:17: error: expected ';' before 'count'
    7 |         longlong count = 0;
      |                 ^~~~~~
      |                 ;
a.cc:8:16: error: 'N' was not declared in this scope
    8 |         cin >> N;
      |                ^
a.cc:13:14: error: 'i' was not declared in this scope
   13 |         for (i = 0; i < N-1 ; i++) {
      |              ^
a.cc:14:9: error: 'c' was not declared in this scope
   14 |         c = vec[i];
      |         ^
a.cc:15:9: error: 'd' was not declared in this scope
   15 |         d = vec[i+1];
      |         ^
a.cc:18:17: error: 'count' was not declared in this scope
   18 |                 count++;
      |                 ^~~~~
a.cc:23:13: error: 'count' was not declared in this scope
   23 |     cout << count << endl;
      |             ^~~~~
Language: C++

#include <bits/stdc++.h>
#define lli long long int
using namespace std;
int main() {
  lli n,a,maxval,uniques,ctr = 0;
  vector<lli> v;
  cin >> n;
  for (lli i = 0; i < n; i++)
  {
    cin >> a;
    v.push_back(a);
  }
  uniques = set<lli>(v.begin(),v.end()).size();
  while (uniques > 1)
  {
    maxval = *max_element(v.begin(),v.end());
    auto maxidx = find(v.begin(),v.end(),maxval);
    ctr += (maxval * distance(maxidx,v.end())) - accumulate(maxidx,v.end(),0);
    v.erase(maxidx,v.end());
    uniques = set<lli>(v.begin(),v.end()).size();
  }
  cout << ctr;
  return 0;

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

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

int main() {
  
  int N;
  cin >> N;
  
  vector<int> vec;
  
  for(int i=0; i<N; i++){
  cin >> vec.at(i);
  }
  int sum=0;
  int a=vec.at(0)
  
  for(int i=1; i<N; i++){
    if(vec.at(i)>=a){
      a=vec.at(i);
    }
    else{
      sum+=(a-vec.at(i))
    }
    
  }
  
 
  
  cout << sum<<endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:3: error: expected ',' or ';' before 'for'
   17 |   for(int i=1; i<N; i++){
      |   ^~~
a.cc:17:16: error: 'i' was not declared in this scope
   17 |   for(int i=1; i<N; i++){
      |                ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:20: error: no matching function for call to 'max(int, ll)'
   11 |         int x = max(0, arr[i-1] - arr[i]);
      |                 ~~~^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:11:20: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   11 |         int x = max(0, arr[i-1] - arr[i]);
      |                 ~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:11:20: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   11 |         int x = max(0, arr[i-1] - arr[i]);
      |                 ~~~^~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
using namespace std;
int height(int N,int A[N]){
  int n = N;
  int sum =0;
  for(int i=0;i<n;i++){
    if(A[i+1]<=A[i]){
      sum+= (A[i]-A[i+1]);
      A[i+1] = A[i];
    }
  }
  return sum;
}
int main(){
  int n;
  cin>>n;
  int A[n] ;
  for(int i=0;i<n;i++){
    cin>>A[i];
  }
  int ans = height(n,A);
  cout<<ans;
  return 0;
}
  


Compiler output:
a.cc:3:25: error: use of parameter outside function body before ']' token
    3 | int height(int N,int A[N]){
      |                         ^
a.cc: In function 'int height(...)':
a.cc:4:11: error: 'N' was not declared in this scope
    4 |   int n = N;
      |           ^
a.cc:7:8: error: 'A' was not declared in this scope
    7 |     if(A[i+1]<=A[i]){
      |        ^
Language: C++

#include <iostream>
using namespace std;
int height(int A[N],int N){
  int n = N;
  int sum =0;
  for(int i=0;i<n;i++){
    if(A[i+1]<=A[i]){
      sum+= (A[i]-A[i+1]);
      A[i+1] = A[i];
    }
  }
  return sum;
}
int main(){
  int n;
  cin>>n;
  int A[n] ;
  for(int i=0;i<n;i++){
    cin>>A[i];
  }
  int ans = height(A,n);
  cout<<ans;
  return 0;
}
  


Compiler output:
a.cc:3:18: error: 'N' was not declared in this scope
    3 | int height(int A[N],int N){
      |                  ^
a.cc:3:20: error: expected ')' before ',' token
    3 | int height(int A[N],int N){
      |           ~        ^
      |                    )
a.cc:3:21: error: expected unqualified-id before 'int'
    3 | int height(int A[N],int N){
      |                     ^~~
Language: C++

#include<iostream>
using namespace std;
int main()
{
  int n;
  cin>>n;
  int arr[n];
  int height = 0;
  cin>>arr[0];
  int max = arr[0];
  for(int i =1;i<n;i++)
  {
    cin>>arr[i];
    if(arr[i] >= max)
    {
      	max =arr[i];
    }
    else
    {
      height += max - arr[i];
    }
  }
  cout<<height<<endl
  
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:21: error: expected ';' before '}' token
   23 |   cout<<height<<endl
      |                     ^
      |                     ;
......
   26 | }
      | ~
Language: C++

#include<iostrem>
using namespace std;
int main(){
  int n;
  cin>>n;
  int a[n],sum=0;
  for(int i=0;i<n;i++){
    cin>>a[i];
    if(i>0){
      sum+=a[i]-a[i-1];
  }
  }
    cout<<sum<<endl;
    return 0;
}

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

#include<iostream>
using namespace std;

void main()
{
		int n,sum = 0, max;
	cin>>n;
	int a[n];
	
	for(int i= 0 ; i < n ; i++)
	cin>>a[i];
	max = a[0];
	
	for( int i = 1; i < n ; i++)
	{
		if( max  > a[i])
		sum = sum + (max - a[i]);
		else
		max = a[i];
	}
	cout<<sum;
}

Compiler output:
a.cc:4:1: error: '::main' must return 'int'
    4 | void main()
      | ^~~~
Language: C++

include <iostream>
using namespace std;
int height(&A,int N){
  int n = N;
  int sum =0;
  for(int i=0;i<n;i++){
    if(A[i+1]<=A[i]){
      sum+= (A[i]-A[i+1]);
      A[i+1] = A[i];
    }
  }
  return sum;
}
int main(){
  int n;
  cin>>n;
  int A[n] ;
  for(int i=0;i<n;i++){
    cin>>A[i];
  }
  int ans = height(A,n);
  cout<<ans;
  return 0;
}
  


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <iostream>
      | ^~~~~~~
a.cc:3:13: error: 'A' was not declared in this scope
    3 | int height(&A,int N){
      |             ^
a.cc:3:15: error: expected primary-expression before 'int'
    3 | int height(&A,int N){
      |               ^~~
a.cc:3:20: error: expression list treated as compound expression in initializer [-fpermissive]
    3 | int height(&A,int N){
      |                    ^
a.cc: In function 'int main()':
a.cc:16:3: error: 'cin' was not declared in this scope
   16 |   cin>>n;
      |   ^~~
a.cc:21:19: error: 'height' cannot be used as a function
   21 |   int ans = height(A,n);
      |             ~~~~~~^~~~~
a.cc:22:3: error: 'cout' was not declared in this scope
   22 |   cout<<ans;
      |   ^~~~
Language: C++

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

int main() {
  	int N, c, d;
  	int count = 0;
  	cin >> N;
    vector<int> vec(N);
  	for (int i = 0; i < N; i++) {
          cin >> vec[i];
    }
    max = vec[0];
  	for (int i = 0; i < N-1 ; i++) {
      	c = vec[i];
        d = vec[i+1];
		while (c > d) {
          	d++;
          	count++;
        }
        vec[i+1] = d;
        
    }
    cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: overloaded function with no contextual type information
   13 |     max = vec[0];
      |                ^
Language: C++

include <iostream>
using namespace std;
int height(&A,int N){
  int n = N;
  int sum =0;
  for(int i=0;i<n;i++){
    if(A[i+1]<=A[i]){
      sum+= (A[i]-A[i+1]);
      A[i+1] = A[i];
    }
  }
  return sum;
}
int main(){
  int n;
  cin>>n;
  int A[n] ;
  for(int i=0;i<n;i++){
    cin>>A[i];
  }
  int ans = height(A,n);
  return ans;
}
  


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <iostream>
      | ^~~~~~~
a.cc:3:13: error: 'A' was not declared in this scope
    3 | int height(&A,int N){
      |             ^
a.cc:3:15: error: expected primary-expression before 'int'
    3 | int height(&A,int N){
      |               ^~~
a.cc:3:20: error: expression list treated as compound expression in initializer [-fpermissive]
    3 | int height(&A,int N){
      |                    ^
a.cc: In function 'int main()':
a.cc:16:3: error: 'cin' was not declared in this scope
   16 |   cin>>n;
      |   ^~~
a.cc:21:19: error: 'height' cannot be used as a function
   21 |   int ans = height(A,n);
      |             ~~~~~~^~~~~
Language: C++

#include<bits/stdc++.h>
#define ll long long int
using namepsace std;
int main()
{
  ll n;
  cin>>n;
  ll a[n];
  ll s=0;
  for(ll i=0;i<n;i++)
  {
    cin>>a[i];
  }
  for(ll i=1;i<n;i++)
  {
    if(a[i-1]>a[i])
      s+=(a[i-1]-a[i])
  }
  cout<<s<<endl;
  return 0;
}

Compiler output:
a.cc:3:7: error: expected nested-name-specifier before 'namepsace'
    3 | using namepsace std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   cin>>n;
      |   ^~~
      |   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:17:23: error: expected ';' before '}' token
   17 |       s+=(a[i-1]-a[i])
      |                       ^
      |                       ;
   18 |   }
      |   ~                    
a.cc:19:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   19 |   cout<<s<<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:19:12: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   19 |   cout<<s<<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<stdio.h>
int  main()
{ int n,d;
  scanf("%d",&n);
  long int ar[n],c=0;
 for(b=0;b<n;b++)
   scanf("%ld",&ar[b]);
 for(b=1;b<n;b++)
 { if(ar[b]<ar[b-1])
 {
   c+=ar[b-1]-ar[b];
    ar[b]=ar[b-1]; 
   
 }   
   
 }
  printf("%ld",c);
  
  
  
  
  
  
  
  
}
  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:6:6: error: 'b' was not declared in this scope
    6 |  for(b=0;b<n;b++)
      |      ^
a.cc:8:6: error: 'b' was not declared in this scope
    8 |  for(b=1;b<n;b++)
      |      ^
Language: C++

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

int main() {
  int N, plus = 0;
  cin >> N;
  if (N == 1) cout << 0 << endl;
  else {
    vector<int> vec(N);
    for (int i = 0; i < N; i++) {
      cin >> vec.at(i);
    }
    for (int i = 0; i < N - 1; i++) {
      if (vec.at(i) > vec.at(i + 1)) {
        plus += vec.at(i) - vec.at(i + 1);
        vec.at(i + 1) = vec.at(i);
      }
    }
    cout << plus << endl;
}


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

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

int main() {
  
  int N;
  cin >> N;
  
  vector<int> vec;
  
  sort(vec.bein(),vec.end());
  
  for(int i=0; i<N; i++){
  cin >> vec.at(i);
  }
   int sum=0;
  
  for(int i=1; i<N){
    sum+=vec.at(i);
  }
  
  cout << sum-(N-1)*vec.at(0) <<endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: 'class std::vector<int>' has no member named 'bein'; did you mean 'begin'?
   11 |   sort(vec.bein(),vec.end());
      |            ^~~~
      |            begin
a.cc:18:19: error: expected ';' before ')' token
   18 |   for(int i=1; i<N){
      |                   ^
      |                   ;
Language: C++

/*
17/10/2017
*/
#include <bits/stdc++.h>
#define ll long long
#define mod 1000000007
using namespace std;
int main()
{
int n;
cin>>n;
int a[n];
for(int i=0;i<n;i++)
{
cin>>a[i];
}
ll mx=0;
ll ans=0;
for(int i=0;i<n;i++)
{
if(a[i]<mx)
{
ans+=mx-a[i];
}
mx=max(a[i],mx);
}
cout<<ans<<endl;
}
/*
 *||||

 */

Compiler output:
a.cc: In function 'int main()':
a.cc:25:7: error: no matching function for call to 'max(int&, long long int&)'
   25 | mx=max(a[i],mx);
      |    ~~~^~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:4:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:25:7: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   25 | mx=max(a[i],mx);
      |    ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:25:7: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   25 | mx=max(a[i],mx);
      |    ~~~^~~~~~~~~
Language: C++

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

int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A.at(i);
  }
  int B = 0;
  int_64 C = 0;
  for (int i = 0; i < N - 1; i++) {
    if (A.at(i) > A.at(i + 1)) {
      B = A.at(i) - A.at(i + 1);
      C += B;
      A.at(i + 1) += B;
    }
  }
  cout << C << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: 'int_64' was not declared in this scope; did you mean 'rintf64'?
   12 |   int_64 C = 0;
      |   ^~~~~~
      |   rintf64
a.cc:16:7: error: 'C' was not declared in this scope
   16 |       C += B;
      |       ^
a.cc:20:11: error: 'C' was not declared in this scope
   20 |   cout << C << endl;
      |           ^
Language: C++

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

int main() {
  int N, plus = 0;
  cin >> N;
  if (N = 1) cout << 0 << endl;
  else {
    vector<int> vec(N);
    for (int i = 0; i < N; i++) {
      cin >> vec.at(i);
    }
    for (int i = 0; i < N - 1; i++) {
      if (vec.at(i) > vec.at(i + 1)) {
        plus += vec.at(i) - vec.at(i + 1);
        vec.at(i + 1) = vec.at(i);
      }
    }
    cout << plus << endl;
}

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

include <iostream>
using namespace std;
long int height(vector<long int> &A,int N){
  int n = N;
  long int sum =0;
  for(int i=0;i<n;i++){
    if(A[i+1]<=A[i]){
      sum+= (A[i]-A[i+1]);
      A[i+1] = A[i];
    }
  }
  return sum;
}
long int main(){
  int n;
  cin>>n;
  vector<long int> A(n,-1) ;
  for(int i=0;i<n;i++){
    cin>>A[i];
  }
  long int ans = height(A,n);
  return ans;
}
  


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <iostream>
      | ^~~~~~~
a.cc:3:17: error: 'vector' was not declared in this scope
    3 | long int height(vector<long int> &A,int N){
      |                 ^~~~~~
a.cc:3:24: error: expected primary-expression before 'long'
    3 | long int height(vector<long int> &A,int N){
      |                        ^~~~
a.cc:3:37: error: expected primary-expression before 'int'
    3 | long int height(vector<long int> &A,int N){
      |                                     ^~~
a.cc:3:42: error: expression list treated as compound expression in initializer [-fpermissive]
    3 | long int height(vector<long int> &A,int N){
      |                                          ^
a.cc:14:6: error: '::main' must return 'int'
   14 | long int main(){
      |      ^~~
a.cc: In function 'int main()':
a.cc:16:3: error: 'cin' was not declared in this scope
   16 |   cin>>n;
      |   ^~~
a.cc:17:3: error: 'vector' was not declared in this scope
   17 |   vector<long int> A(n,-1) ;
      |   ^~~~~~
a.cc:17:10: error: expected primary-expression before 'long'
   17 |   vector<long int> A(n,-1) ;
      |          ^~~~
a.cc:19:10: error: 'A' was not declared in this scope
   19 |     cin>>A[i];
      |          ^
a.cc:21:25: error: 'A' was not declared in this scope
   21 |   long int ans = height(A,n);
      |                         ^
a.cc:21:24: error: 'height' cannot be used as a function
   21 |   long int ans = height(A,n);
      |                  ~~~~~~^~~~~
Language: C++

#include<stdio.h>
int  main()
{ int n,d;
  scanf("%d",&n);
  long int ar[n],c=0;
 for(b=0;b<n;b++)
   scanf("%ld",&ar[b]);
 for(b=1;b<n;b++)
 { if(ar[b]<ar[b-1])
 {
   c+=ar[b]-ar[b-1];
    ar[b-1]=ar[b]; 
   
 }   
   
 }
  printf("%ld",c);
  
  
  
  
  
  
  
  
}
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:6:6: error: 'b' was not declared in this scope
    6 |  for(b=0;b<n;b++)
      |      ^
a.cc:8:6: error: 'b' was not declared in this scope
    8 |  for(b=1;b<n;b++)
      |      ^
Language: Java

import java.util.Scanner;

public class b {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        int[]a=new int[n];
        int sum=0;
        for(int i=0;i<n;i++)a[i]=sc.nextInt();
        for(int i=0;i<n-1;i++){
            if(a[i]<a[i+1]){
               sum+=a[i+1]-a[i];
            }
        }
        System.out.println(sum);
    }
}


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

using namespace std;

int main() {
    int N; cin >> N;
    vector<long long> tall(N);
    for(int i=0; i<N; i++){
        cin >> tall.at(i);
    }
    long long ans=0;
    
    for(int i=0; i<N-1; i++){
        if(tall.at(i)>tall.at(i+1)){
            ans=ans+(tall.at(i)-tall.at(i+1));
            tall.at(i+1)=tall.at(i);
            
        }
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:12: error: 'cin' was not declared in this scope
    4 |     int N; cin >> N;
      |            ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:5:5: error: 'vector' was not declared in this scope
    5 |     vector<long long> tall(N);
      |     ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | using namespace std;
a.cc:5:12: error: expected primary-expression before 'long'
    5 |     vector<long long> tall(N);
      |            ^~~~
a.cc:7:16: error: 'tall' was not declared in this scope
    7 |         cin >> tall.at(i);
      |                ^~~~
a.cc:12:12: error: 'tall' was not declared in this scope
   12 |         if(tall.at(i)>tall.at(i+1)){
      |            ^~~~
a.cc:18:5: error: 'cout' was not declared in this scope
   18 |     cout << ans << endl;
      |     ^~~~
a.cc:18:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:18:20: error: 'endl' was not declared in this scope
   18 |     cout << ans << endl;
      |                    ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C++

#include <bits/stdc++.h>

int main()
{
    unsigned long longN;
    std::cin >> N;

    unsigned long longA[N];
    for(unsigned long longi=0; i<N; i++)
        std::cin >> A[i];
    
    unsigned long longBbfr = 0;
    unsigned long longBaft;
    unsigned long longsum = 0;

    for(unsigned long longj=0; j<N-1; j++) // uekizan
    {
        if(A[j]+Bbfr > A[j+1])
        {
            Baft=A[j]+Bbfr-A[j+1];
        }
        else
        {
            Baft = 0;
        }
        

        sum+=Baft;

        Bbfr=Baft;
    }
    std::cout << sum << std::endl;

    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:17: error: 'N' was not declared in this scope
    6 |     std::cin >> N;
      |                 ^
a.cc:9:32: error: 'i' was not declared in this scope
    9 |     for(unsigned long longi=0; i<N; i++)
      |                                ^
a.cc:10:21: error: 'A' was not declared in this scope
   10 |         std::cin >> A[i];
      |                     ^
a.cc:16:32: error: 'j' was not declared in this scope; did you mean 'jn'?
   16 |     for(unsigned long longj=0; j<N-1; j++) // uekizan
      |                                ^
      |                                jn
a.cc:18:12: error: 'A' was not declared in this scope
   18 |         if(A[j]+Bbfr > A[j+1])
      |            ^
a.cc:18:17: error: 'Bbfr' was not declared in this scope
   18 |         if(A[j]+Bbfr > A[j+1])
      |                 ^~~~
a.cc:20:13: error: 'Baft' was not declared in this scope
   20 |             Baft=A[j]+Bbfr-A[j+1];
      |             ^~~~
a.cc:24:13: error: 'Baft' was not declared in this scope
   24 |             Baft = 0;
      |             ^~~~
a.cc:28:9: error: 'sum' was not declared in this scope
   28 |         sum+=Baft;
      |         ^~~
a.cc:28:14: error: 'Baft' was not declared in this scope
   28 |         sum+=Baft;
      |              ^~~~
a.cc:30:9: error: 'Bbfr' was not declared in this scope
   30 |         Bbfr=Baft;
      |         ^~~~
a.cc:32:18: error: 'sum' was not declared in this scope
   32 |     std::cout << sum << std::endl;
      |                  ^~~
Language: Java

import java.util.*;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int[] a = new int[n];
    for (int i = 0; i < n; i++) {
      a[i] = sc.nextInt();
    }
    int sum = 0;
    for (int i = 0; i < n - 1; i++) {
      if(a[i] > a[i + 1]) {
        int dai = a[i] - a[i + 1];
        sum = sum + dai;
        a[i + 1] = a[i];
    }
    System.out.println(sum);
  }
}

Compiler output:
Main.java:20: error: reached end of file while parsing
}
 ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define A 1000000000;
int main(){
 long long n;
 long long ans =0;
 cin >> n;
 static int a[A];
 for(int i=0;i<n;i++){
  cin >> a[i];
  if(i!=0&&a[i-1]>a[i]){
    ans = ans + a[i-1]-a[i];
    a[i]=a[i-1];
  }
 }
 
 cout << ans <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:21: error: expected ']' before ';' token
    3 | #define A 1000000000;
      |                     ^
a.cc:8:15: note: in expansion of macro 'A'
    8 |  static int a[A];
      |               ^
a.cc:8:16: error: expected primary-expression before ']' token
    8 |  static int a[A];
      |                ^
a.cc:10:10: error: 'a' was not declared in this scope
   10 |   cin >> a[i];
      |          ^
Language: Java

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

public class Solution {
    static class FastReader { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastReader() { 
            br = new BufferedReader(new
                     InputStreamReader(System.in)); 
        } 
  
        String next() { 
            while (st == null || !st.hasMoreElements()) { 
                try { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int nextInt() { 
            return Integer.parseInt(next()); 
        } 
  
        long nextLong() { 
            return Long.parseLong(next()); 
        } 
  
        double nextDouble() { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() { 
            String str = ""; 
            try { 
                str = br.readLine(); 
            } 
            catch (IOException e) { 
                e.printStackTrace(); 
            } 
            return str; 
        } 
    }
    
	public static void main (String[] args) throws IOException {
		FastReader sc = new FastReader();
		int n = sc.nextInt();
		long count = 0;
		int max = Integer.MIN_VALUE;
		
		for (int i = 0; i < n; i++) {
		    int val = sc.nextInt();
		    max = Math.max(max, val);
		    
		    if (val < max) 
		        count += (max - val);
		}
		
		System.out.println(count);
	}
}

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

import java.util.*;
import java.lang.*;

public class Main{
    public static void main(String[]args){
	int ans=0;
        Scanner sc = new Scanner(System.in);
	int N=sc.nextInt();
	int a[]=new int[N];
	int b[]=new int[N];
	a[0]=sc.nextInt();
	b[0]=a[0];
	for(int i=1; i<N; i++){
	    a[i]=sc.nextInt();
	    b[i]=a[i];
	    if(b[i]<b[i-1]){
		b[i]=b[i-1];
	    }
	}
	int a_sum=IntStream.of(a).sum();
	int b_sum=IntStream.of(a).sum();
	System.out.println(b_sum-a_sum);
	
    }
}


Compiler output:
Main.java:20: error: cannot find symbol
	int a_sum=IntStream.of(a).sum();
	          ^
  symbol:   variable IntStream
  location: class Main
Main.java:21: error: cannot find symbol
	int b_sum=IntStream.of(a).sum();
	          ^
  symbol:   variable IntStream
  location: class Main
2 errors
Language: C++

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

int main(){
 long long n;
 long long ans =0;
 cin >> n;
 static int a[n];
 for(int i=0;i<n;i++){
  cin >> a[i];
  if(i!=0&&a[i-1]>a[i]){
    ans = ans + a[i-1]-a[i];
    a[i]=a[i-1];
  }
 }
 
 cout << ans <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: storage size of 'a' isn't constant
    8 |  static int a[n];
      |             ^
Language: C++

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

int main(){
long long n,i,t;
 cin>>n;
 vector<long long> v;
 long long sum=0;
 for(i=0;i<n;i++){
    cin>>t;
    v.push_back(t);
 }
 for(i=0;i<n-1;i++){
    if(v[i]>v[i+1]){
        sum=sum+(v[i]-v[i+1])
        v[i]=v[i+1];
    }
 }
 cout<<sum;
   


    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:30: error: expected ';' before 'v'
   15 |         sum=sum+(v[i]-v[i+1])
      |                              ^
      |                              ;
   16 |         v[i]=v[i+1];
      |         ~