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

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

using namespace std;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef long long ll;

#define pb push_back

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	int n;
	cin >> n;
	ll mx = 0, ans = 0;
	while (n--) {
		int x;
		cin >> x;
		if (x < mx) ans += mx - x;
		mx = max(mx, x);
	}
	cout << ans;
   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:25: error: no matching function for call to 'max(ll&, int&)'
   22 |                 mx = max(mx, x);
      |                      ~~~^~~~~~~
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:2:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:22:25: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   22 |                 mx = max(mx, x);
      |                      ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
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:22:25: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   22 |                 mx = max(mx, x);
      |                      ~~~^~~~~~~
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[i];
  }
  long long int ans = 0;
  for (int i = 1; i < n; i++){
    if (a.at(i-1) > a.at(i)){
      ans = ans + (a.at(i-1)-a.at(i));
      a.at(i) = a.at(i-1);
    }
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: 'A' was not declared in this scope
    8 |     cin >> A[i];
      |            ^
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 sum = 0;
  for (int i = 1; i<n; i++) {
    s = A.at(i-1) - A.at(i);
    if (A.at(i) < A.at(i-1)) {
      A.at(i) += s;
      sum += s;
    }
  }
  cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 's' was not declared in this scope
   13 |     s = A.at(i-1) - A.at(i);
      |     ^
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 count=0;
  max=A.at(0);
  for(int i=0;i<N-1;i++){
    if(max>=A.at(i+1)){
      count+=max-A.at(i+1);
    }else{
      max=A.at(i+1);
    }
  }
  cout<<count<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: overloaded function with no contextual type information
   11 |   max=A.at(0);
      |             ^
a.cc:13:11: error: invalid operands of types '<unresolved overloaded function type>' and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} to binary 'operator>='
   13 |     if(max>=A.at(i+1)){
      |        ~~~^~~~~~~~~~~
a.cc:14:17: error: invalid operands of types '<unresolved overloaded function type>' and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} to binary 'operator-'
   14 |       count+=max-A.at(i+1);
      |              ~~~^~~~~~~~~~
a.cc:16:19: error: overloaded function with no contextual type information
   16 |       max=A.at(i+1);
      |                   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin>>N;
  vector <int> A(N);
  for(int i:N){
    cin>>A.at(i);
  }
  int count=0;
  max=A.at(0);
  for(int i=0;i<N-1;i++){
    if(max>=A.at(i+1)){
      count+=max-A.at(i+1);
    }else{
      max=A.at(i+1);
    }
  }
  cout<<count<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:13: error: 'begin' was not declared in this scope
    7 |   for(int i:N){
      |             ^
a.cc:7:13: note: suggested alternatives:
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166,
                 from a.cc:1:
/usr/include/c++/14/valarray:1238:5: note:   'std::begin'
 1238 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
In file included from /usr/include/c++/14/filesystem:53,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200:
/usr/include/c++/14/bits/fs_dir.h:608:3: note:   'std::filesystem::__cxx11::begin'
  608 |   begin(recursive_directory_iterator __iter) noexcept
      |   ^~~~~
a.cc:7:13: error: 'end' was not declared in this scope
    7 |   for(int i:N){
      |             ^
a.cc:7:13: note: suggested alternatives:
/usr/include/c++/14/valarray:1265:5: note:   'std::end'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/bits/fs_dir.h:613:3: note:   'std::filesystem::__cxx11::end'
  613 |   end(recursive_directory_iterator) noexcept
      |   ^~~
a.cc:11:13: error: overloaded function with no contextual type information
   11 |   max=A.at(0);
      |             ^
a.cc:13:11: error: invalid operands of types '<unresolved overloaded function type>' and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} to binary 'operator>='
   13 |     if(max>=A.at(i+1)){
      |        ~~~^~~~~~~~~~~
a.cc:14:17: error: invalid operands of types '<unresolved overloaded function type>' and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} to binary 'operator-'
   14 |       count+=max-A.at(i+1);
      |              ~~~^~~~~~~~~~
a.cc:16:19: error: overloaded function with no contextual type information
   16 |       max=A.at(i+1);
      |                   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  cin>>int N;
  int vector <int> A(N);
  for(int i:N){
    cin>>A.at(i);
  }
  int count=0;
  max=A.at(0);
  for(int i=0;i<N-1;i++){
    if(max>=A.at(i+1)){
      count+=max-A.at(i+1);
    }else{
      max=A.at(i+1);
    }
  }
  cout<<count<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:8: error: expected primary-expression before 'int'
    4 |   cin>>int N;
      |        ^~~
a.cc:5:20: error: invalid declarator before 'A'
    5 |   int vector <int> A(N);
      |                    ^
a.cc:6:13: error: 'N' was not declared in this scope
    6 |   for(int i:N){
      |             ^
a.cc:7:10: error: 'A' was not declared in this scope
    7 |     cin>>A.at(i);
      |          ^
a.cc:10:7: error: 'A' was not declared in this scope
   10 |   max=A.at(0);
      |       ^
a.cc:11:17: error: 'N' was not declared in this scope
   11 |   for(int i=0;i<N-1;i++){
      |                 ^
Language: C++

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

int main(){
  int n;
  cin >> n;
  long long ans =0;
  long long a =0;
  long long b =0;
  cin >> a;
  for(int i=0;i<n-1;i++){
   cin >> b;
    if(a>b){
      ans += (a-b);
     
      a = max(a,b);
    }
    else a = max(a,b);
  }z
  
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:4: error: 'z' was not declared in this scope
   19 |   }z
      |    ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

long long N, ans, mx;

int main()
{
    cin >> N;
    long long arr[N];
    for (long long i = 0 ; i < N ; i ++) {
        cin >> arr[i];
    }
    for (long long i = 0 ; i < N ; i ++) {
        mx = max(mx, arr[i]);
        ans += hell - arr[i];
    }
    cout << ans;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:16: error: 'hell' was not declared in this scope
   16 |         ans += hell - arr[i];
      |                ^~~~
Language: C

#include<stdio.h>
int main(){
    int n, a[200000];
	long long cnt = 0;
    scanf("%d", &n);
    for(int i=0;i<n;i++){
        scanf("%d", &a[i]);++
    }
    for(int i=1;i<n;i++){
    	if(a[i] < a[i-1]){
            cnt += a[i-1] - a[i];
            a[i] = a[i-1];
        }
	} 
    printf("%lld\n", cnt);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:5: error: expected expression before '}' token
    8 |     }
      |     ^
Language: C

#include<stdio.h>
int main(){
    int n, a[200000];
	long long cnt = 0;
    scanf("%d", &n);
    for(int i=0;i<n;i++){
        scanf("%d", &a[i]);++
    }
    for(int i=1;i<n;i++){
    	if(a[i] < a[i-1]){
            cnt += a[i-1] - a[i];
            a[i] = a[i-1];
        }
	} 
    printf("%d\n", cnt);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:5: error: expected expression before '}' token
    8 |     }
      |     ^
Language: C++

#include <vector>
#include <algorithm>
using namespace std;
 
int main(){
    int N;
    cin >> N;
    vector<int> A(N);
    for (int i = 0; i < N; i++)
    {
        cin >> A[i];
    }
 
    long long ans = 0;
    int MaxNum = 0;
    for (int i = 0; i < N; i++)
    {
        //Use common MaxNum to reduce the compuation time
        MaxNum = max(MaxNum, A[i]);
        int Bi = MaxNum;
        ans += Bi - A[i];
    }
 
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope
    7 |     cin >> N;
      |     ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include <algorithm>
  +++ |+#include <iostream>
    3 | using namespace std;
a.cc:24:5: error: 'cout' was not declared in this scope
   24 |     cout << ans << endl;
      |     ^~~~
a.cc:24:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:24:20: error: 'endl' was not declared in this scope
   24 |     cout << ans << endl;
      |                    ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include <algorithm>
  +++ |+#include <ostream>
    3 | using namespace std;
Language: C++

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

int main() {
    int N;
    cin >> N;
    vector<int> tall(N);
    int max=0
    long total_step=0;
    for (int i=0; i<N; i++) {
        cin >> tall[i];
        if (max > tall[i]) {
            total_step += max - tall[i];
        }
        if (tall[i] > max) {
            max = tall[i];
        }
    }

    cout << total_step;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: expected ',' or ';' before 'long'
   10 |     long total_step=0;
      |     ^~~~
a.cc:14:13: error: 'total_step' was not declared in this scope
   14 |             total_step += max - tall[i];
      |             ^~~~~~~~~~
a.cc:21:13: error: 'total_step' was not declared in this scope
   21 |     cout << total_step;
      |             ^~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
  ll n,i,ans=0;
  cin>>n;
  ll arr[n]={0};
  for(i=0;i<n;i++){
    cin>>arr[i];  
  }
  ll maxi=arr[0];
  for(i=0;i<n;i++){
    if(arr[i]>maxi)maxi=arr[i];
    ans+=abs(maxi-arr[i]);
  }
  cour<<ans<<"\n";
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:3: error: 'cour' was not declared in this scope
   16 |   cour<<ans<<"\n";
      |   ^~~~
Language: C++

#include <iostream>
#include<string.h>
#include<vector>
using namespace std;
int main()
{
   long long int n;
   vector<long long> v ;
   cin>>n;
   long long int stool=0;
   for(long int i=0;i<n;++i)
   {cin>>x;v.push_back(x);}
   
  if(n==1) cout<<0<<endl;
  else
  {for(long int i=1;i<n;++i)
   {
       
       if(v[i]<v[i-1])
       {
           stool=stool+(v[i-1]-v[i]);
           v[i]=v[i-1];
       }
   }
   cout<<stool;}
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: 'x' was not declared in this scope
   12 |    {cin>>x;v.push_back(x);}
      |          ^
Language: C++

#include<bits/stdc++.h>
int main() {
  int N; cin >> N;
  int p = 0;
  long long res = 0;
  for (int i = 0; i < N; i++) {
    int x; cin >> x;
    res += max(p - x, 0);
    p = max(p, x);
  }
  cout << res << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:10: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    3 |   int N; 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:8:12: error: 'max' was not declared in this scope; did you mean 'std::max'?
    8 |     res += max(p - x, 0);
      |            ^~~
      |            std::max
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:11:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   11 |   cout << res << 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:11:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   11 |   cout << res << 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>
using namespace std;
int main()
{
	int N,sum=0;
	int a[];
	cin>>N;
	for(int i=0;i<N;i++)
	{
		cin>>a[i];
	}
	
	for(int i=0;i<N-1;i++)
	{
		if(a[i+1]<a[i]) 
		{
		    sum+=(a[i]-a[i+1]);
		    a[i+1]=a[i];
	    }
	}
	cout<<sum;
}


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


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

#define li long long int
#define rep(i, to) for (li i = 0; i < ((li)(to)); i++)
#define repp(i, start, to) for (li i = (li)(start); i < ((li)(to)); i++)

#define F first
#define S second

typedef pair<li, li> PI;
map<PI, li> cnt;

int main(void)
{
	li n;
	li res=0;
	li prev = 0;
	rin{
		li a;
		cin>>a;
		res += min(0ll, prev-a);
		prev=a;
	}
	cout<<res<<endl;


	return 0;
}

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

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

long long n,ans,mx;
int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cin>>n;
    for (int i = 0,h; i < n; ++i) {
        cin>>h;
        mx = max(h,mx);
        ans += mx-h;
    }
    cout<<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: no matching function for call to 'max(int&, long long int&)'
   11 |         mx = max(h,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: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:17: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   11 |         mx = max(h,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:11:17: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   11 |         mx = max(h,mx);
      |              ~~~^~~~~~
Language: C++

#include<bits/stdc++.h> 
#define ll long long 
#define pb push_back
#define vec vector<int>
#define fo(i,n) for (int i = 0; i < n; i++)
#define so(v) sort(v.begin(), v.end())
#define fi first
#define se second
using namespace std;  




int main()
{

ll n;
cin>>n;
vector<int> v(n);
for(int i=0;i<n;i++)
{
    cin>>v[i];
}

       
       ll maxx = 0 , count = 0;
     for(int i = 0; i < n;i++){
     	maxx = max(maxx , v[i]);
     	count += (maxx - v[i]);
     }
     cout<<count<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:19: error: no matching function for call to 'max(long long int&, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)'
   28 |         maxx = max(maxx , v[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:28:19: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'})
   28 |         maxx = max(maxx , v[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:28:19: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   28 |         maxx = max(maxx , v[i]);
      |                ~~~^~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;
long long n,maxn,ans,x;
int main()
{
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        cin>>x;
        ans+=max(maxn-x,0);
        maxn=max(maxn,x);
    }
    cout<<ans;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: no matching function for call to 'max(long long int, int)'
   11 |         ans+=max(maxn-x,0);
      |              ~~~^~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:11:17: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   11 |         ans+=max(maxn-x,0);
      |              ~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
Language: C++

#include<bits/stdc++.h>
#define int long long int;
using namespace std;
int32_t main()
{
	int a; cin >> a;
	int arr[a + 50];
	for(int i=0; i<a; i++)
		cin >> arr[i];
	int ans = 0;
	for(int i=0; i < a - 1; i++)
	{
		if(arr[i] > arr[i + 1])
		{
			ans += arr[i] - arr[i + 1];
			arr[i + 1] = arr[i];
		}
	}
	cout << ans << '\n';
}

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:2:23: error: declaration does not declare anything [-fpermissive]
    2 | #define int long long int;
      |                       ^~~
a.cc:6:9: note: in expansion of macro 'int'
    6 |         int a; cin >> a;
      |         ^~~
a.cc:6:13: error: 'a' was not declared in this scope
    6 |         int a; cin >> a;
      |             ^
a.cc:2:23: error: declaration does not declare anything [-fpermissive]
    2 | #define int long long int;
      |                       ^~~
a.cc:7:9: note: in expansion of macro 'int'
    7 |         int arr[a + 50];
      |         ^~~
a.cc:7:13: error: 'arr' was not declared in this scope
    7 |         int arr[a + 50];
      |             ^~~
a.cc:2:23: error: declaration does not declare anything [-fpermissive]
    2 | #define int long long int;
      |                       ^~~
a.cc:8:13: note: in expansion of macro 'int'
    8 |         for(int i=0; i<a; i++)
      |             ^~~
a.cc:8:17: error: 'i' was not declared in this scope
    8 |         for(int i=0; i<a; i++)
      |                 ^
a.cc:8:25: error: expected ')' before ';' token
    8 |         for(int i=0; i<a; i++)
      |            ~            ^
      |                         )
a.cc:8:27: error: 'i' was not declared in this scope
    8 |         for(int i=0; i<a; i++)
      |                           ^
a.cc:2:23: error: declaration does not declare anything [-fpermissive]
    2 | #define int long long int;
      |                       ^~~
a.cc:10:9: note: in expansion of macro 'int'
   10 |         int ans = 0;
      |         ^~~
a.cc:10:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   10 |         int ans = 0;
      |             ^~~
      |             abs
a.cc:2:23: error: declaration does not declare anything [-fpermissive]
    2 | #define int long long int;
      |                       ^~~
a.cc:11:13: note: in expansion of macro 'int'
   11 |         for(int i=0; i < a - 1; i++)
      |             ^~~
a.cc:11:31: error: expected ')' before ';' token
   11 |         for(int i=0; i < a - 1; i++)
      |            ~                  ^
      |                               )
Language: C++

#include<bits/stdc++.h>
#define int long long int;
using namespace std;
int main()
{
	int a; cin >> a;
	int arr[a + 50];
	for(int i=0; i<a; i++)
		cin >> arr[i];
	int ans = 0;
	for(int i=0; i < a - 1; i++)
	{
		if(arr[i] > arr[i + 1])
		{
			ans += arr[i] - arr[i + 1];
			arr[i + 1] = arr[i];
		}
	}
	cout << ans << '\n';
}

Compiler output:
a.cc:2:23: error: declaration does not declare anything [-fpermissive]
    2 | #define int long long int;
      |                       ^~~
a.cc:4:1: note: in expansion of macro 'int'
    4 | int main()
      | ^~~
a.cc:4:5: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | int main()
      |     ^~~~
a.cc: In function 'int main()':
a.cc:2:23: error: declaration does not declare anything [-fpermissive]
    2 | #define int long long int;
      |                       ^~~
a.cc:6:9: note: in expansion of macro 'int'
    6 |         int a; cin >> a;
      |         ^~~
a.cc:6:13: error: 'a' was not declared in this scope
    6 |         int a; cin >> a;
      |             ^
a.cc:2:23: error: declaration does not declare anything [-fpermissive]
    2 | #define int long long int;
      |                       ^~~
a.cc:7:9: note: in expansion of macro 'int'
    7 |         int arr[a + 50];
      |         ^~~
a.cc:7:13: error: 'arr' was not declared in this scope
    7 |         int arr[a + 50];
      |             ^~~
a.cc:2:23: error: declaration does not declare anything [-fpermissive]
    2 | #define int long long int;
      |                       ^~~
a.cc:8:13: note: in expansion of macro 'int'
    8 |         for(int i=0; i<a; i++)
      |             ^~~
a.cc:8:17: error: 'i' was not declared in this scope
    8 |         for(int i=0; i<a; i++)
      |                 ^
a.cc:8:25: error: expected ')' before ';' token
    8 |         for(int i=0; i<a; i++)
      |            ~            ^
      |                         )
a.cc:8:27: error: 'i' was not declared in this scope
    8 |         for(int i=0; i<a; i++)
      |                           ^
a.cc:2:23: error: declaration does not declare anything [-fpermissive]
    2 | #define int long long int;
      |                       ^~~
a.cc:10:9: note: in expansion of macro 'int'
   10 |         int ans = 0;
      |         ^~~
a.cc:10:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   10 |         int ans = 0;
      |             ^~~
      |             abs
a.cc:2:23: error: declaration does not declare anything [-fpermissive]
    2 | #define int long long int;
      |                       ^~~
a.cc:11:13: note: in expansion of macro 'int'
   11 |         for(int i=0; i < a - 1; i++)
      |             ^~~
a.cc:11:31: error: expected ')' before ';' token
   11 |         for(int i=0; i < a - 1; i++)
      |            ~                  ^
      |                               )
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(i);
  }
  sort(a.rbegin(), a.rend());
  int ans = 0;
  for (int i = 0; i < n; i++) {
    ans += a(n) - a(i);
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: no match for call to '(std::vector<int>) (int&)'
    9 |     cin >> a(i);
      |            ~^~~
a.cc:14:13: error: no match for call to '(std::vector<int>) (int&)'
   14 |     ans += a(n) - a(i);
      |            ~^~~
a.cc:14:20: error: no match for call to '(std::vector<int>) (int&)'
   14 |     ans += a(n) - a(i);
      |                   ~^~~
Language: C++

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

int main() {
  int n;
  cin >> n;
  vector<int> a[i];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a.rbegin(), a.rend());
  int ans = 0;
  for (int i = 0; i < n; i++) {
    ans += a[n] - a[i];
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: 'i' was not declared in this scope
    7 |   vector<int> a[i];
      |                 ^
a.cc:9:12: error: 'a' was not declared in this scope
    9 |     cin >> a[i];
      |            ^
a.cc:11:8: error: 'a' was not declared in this scope
   11 |   sort(a.rbegin(), a.rend());
      |        ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'unit64_t' was not declared in this scope; did you mean 'uint64_t'?
    8 |   unit64_t a[n-1];
      |   ^~~~~~~~
      |   uint64_t
a.cc:10:10: error: 'a' was not declared in this scope
   10 |   cin >> a[i];
      |          ^
a.cc:12:11: error: expected ';' before 'l'
   12 |   unit64_t l;
      |           ^~
      |           ;
a.cc:13:3: error: 'l' was not declared in this scope
   13 |   l=0;
      |   ^
a.cc:15:10: error: 'a' was not declared in this scope
   15 |      if (a[i] < a[i-1])
      |          ^
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);
  }
  
  long long sum = 0;
  int max_height = 0;
  for (int i = 0; i < n; i++) {
    if (a.at(i) < max_height) {
      sum += max_height - a.at(i);
    }
    man_height = max(max_height, a.at(i));
  }
  cout << sum << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:5: error: 'man_height' was not declared in this scope; did you mean 'max_height'?
   18 |     man_height = max(max_height, a.at(i));
      |     ^~~~~~~~~~
      |     max_height
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a;
  int i,j;
  int sum_a = 0;
  int sum_b = 0;
  int max_vec;
  int sum_dai_height;
  int vec_point;
  
 
  cin >> a ;
  
  vector <int>vec(a);
  for(i=0;i<a;i++){
    cin >> vec.at(i);
    }
  max_vec = vec.at(0);
  sum_dai_height = 0;
  
  for(i=0;i<a;i++){
  if(vec.at(i)>max_vec){
    max_vec = vec.at(i);
  }
    else {
      sum_dai_height = sum_dai_height + max_vec - vec.at(i);
    }
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:30:4: error: expected '}' at end of input
   30 |   }
      |    ^
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;
  ll a[n-1];
    for (int i=0; i<n; i++){
  cin >> a[i];
    }
  int k;
  k=0;
  int l;
  l=0;
  for (int i=0; i<n; i++){
     if (k<a[i])
     { k=a[i];
     }
    l=l+k-a[i];
  }
 cout << l <<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'll' was not declared in this scope
    8 |   ll a[n-1];
      |   ^~
a.cc:10:10: error: 'a' was not declared in this scope
   10 |   cin >> a[i];
      |          ^
a.cc:17:12: error: 'a' was not declared in this scope
   17 |      if (k<a[i])
      |            ^
a.cc:20:11: error: 'a' was not declared in this scope
   20 |     l=l+k-a[i];
      |           ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:20:11: error: expected ';' before 'return'
   20 |  cout << l
      |           ^
      |           ;
   21 |   return 0;
      |   ~~~~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:16:14: error: expected ';' before '}' token
   16 |      { k=a[i]
      |              ^
      |              ;
   17 |      }
      |      ~        
a.cc:18:15: error: expected ';' before '}' token
   18 |     l=l+k-a[i]
      |               ^
      |               ;
   19 |   }
      |   ~            
a.cc:20:11: error: expected ';' before 'return'
   20 |  cout << l
      |           ^
      |           ;
   21 |   return 0;
      |   ~~~~~~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:10:22: error: 'N' was not declared in this scope
   10 |         vector<ll> a(N);
      |                      ^
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    long sum = 0;
    
    for (int i = 0; i < N; i++) {
      long height = sc.nextLong();
      if (height(i) <= height(i - 1)) {
        long sa = height(i - 1) - height(i);
        height(i) += sa;
        sum += sa;
      } 
    }
    System.out.println(sum);
  }
}
      

Compiler output:
Main.java:11: error: cannot find symbol
      if (height(i) <= height(i - 1)) {
          ^
  symbol:   method height(int)
  location: class Main
Main.java:11: error: cannot find symbol
      if (height(i) <= height(i - 1)) {
                       ^
  symbol:   method height(int)
  location: class Main
Main.java:12: error: cannot find symbol
        long sa = height(i - 1) - height(i);
                  ^
  symbol:   method height(int)
  location: class Main
Main.java:12: error: cannot find symbol
        long sa = height(i - 1) - height(i);
                                  ^
  symbol:   method height(int)
  location: class Main
Main.java:13: error: cannot find symbol
        height(i) += sa;
        ^
  symbol:   method height(int)
  location: class Main
5 errors
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
  {int64_t N, m{}, s{}, A; cin >> N;
  while (cin >> A) s += max(0LL, m - A), m = max(m, A);
  cout << s;}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:28: error: no matching function for call to 'max(long long int, int64_t)'
    5 |   while (cin >> A) s += max(0LL, m - A), m = max(m, A);
      |                         ~~~^~~~~~~~~~~~
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:5:28: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int64_t' {aka 'long int'})
    5 |   while (cin >> A) s += max(0LL, m - A), m = max(m, A);
      |                         ~~~^~~~~~~~~~~~
/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:5:28: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
    5 |   while (cin >> A) s += max(0LL, m - A), m = max(m, A);
      |                         ~~~^~~~~~~~~~~~
Language: C++

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

int main()
{
    ll N;
    cin >> N;
    ll maxHeight=0;
    ll totalHeight=0;

    while(N--)
    {
        ll height;
        cin >> height;
        if(height >= maxHeight)
        {
            maxHeight = height;
        }
        else if(height < maxHeight)
        {
            totalHeight += maxHeight - height;
        }
    }
    cout << totalHeight;
    return 0;
}

Compiler output:
a.cc:3:1: error: expected initializer before 'using'
    3 | using namespace std;
      | ^~~~~
a.cc: In function 'int main()':
a.cc:7:5: error: 'll' was not declared in this scope
    7 |     ll N;
      |     ^~
a.cc:8:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |     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:8:12: error: 'N' was not declared in this scope
    8 |     cin >> N;
      |            ^
a.cc:9:7: error: expected ';' before 'maxHeight'
    9 |     ll maxHeight=0;
      |       ^~~~~~~~~~
      |       ;
a.cc:10:7: error: expected ';' before 'totalHeight'
   10 |     ll totalHeight=0;
      |       ^~~~~~~~~~~~
      |       ;
a.cc:14:11: error: expected ';' before 'height'
   14 |         ll height;
      |           ^~~~~~~
      |           ;
a.cc:15:16: error: 'height' was not declared in this scope
   15 |         cin >> height;
      |                ^~~~~~
a.cc:16:22: error: 'maxHeight' was not declared in this scope
   16 |         if(height >= maxHeight)
      |                      ^~~~~~~~~
a.cc:22:13: error: 'totalHeight' was not declared in this scope
   22 |             totalHeight += maxHeight - height;
      |             ^~~~~~~~~~~
a.cc:25:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   25 |     cout << totalHeight;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:25:13: error: 'totalHeight' was not declared in this scope
   25 |     cout << totalHeight;
      |             ^~~~~~~~~~~
Language: C++

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

const int N = 2e5 + 5;
int a[N];

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

    int n;
    cin >> n;

    for(int i = 0; i < n; i++)
    {
        cin >> a[i];
    }
    long long mx = a[0], ans = 0;
    for(int i = 1; i < n; i++)
    {
        mx = max(mx, a[i]);
        if(a[i - 1] > a[i])
        {
            ans += mx - a[i];
        }
    }
    cout << ans << '\n';



    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:22:17: error: no matching function for call to 'max(long long int&, int&)'
   22 |         mx = max(mx, a[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:22:17: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   22 |         mx = max(mx, a[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:22:17: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   22 |         mx = max(mx, a[i]);
      |              ~~~^~~~~~~~~~
Language: C++

#include <iostream>
using namespace std;
typedef long long int ll;
int main(){
  int n;cin>>n;
  ll a[n] , ma =0 , ans =0;
  for (int i=0;i<n;++i){cin>>a[i];ans+=max(0ll,ma-a[i]);ma = max(ma,ans[i]);}
  cout<<ans;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:72: error: invalid types 'll {aka long long int}[int]' for array subscript
    7 |   for (int i=0;i<n;++i){cin>>a[i];ans+=max(0ll,ma-a[i]);ma = max(ma,ans[i]);}
      |                                                                        ^
Language: C++

#include<bits/stdc++.h>
#include<vector>
#include<string>
using namespace std;
#define l long long
#define pb push_back
#define mem(a,n) memset(a,n,sizeof(a))
//#define find(v,n) find(v.begin(),v.end(),n)
#define sort1(v) sort(v.begin(),v.end())
#define lb(v,n) lower_bound(v.begin(),v.end(),n)-v.begin()
//#define ub(v,n) upper_bound(v.begin(),v.end(),n)-v.begin()
#define mod 1000000007
#define reverse(s) reverse(s.begin(),s.end())
//#define pi pair<l,l> 
const double pi=3.141592653589793;
bool isprime(l n)
{
	for(l i=2;i*i<=n;i++)
	{
		if(n%i==0)
			return false;
	}
	return true;
}
/*bool fact(l n)
{
	vector<l> v;
	for(l i=2;i*i<=n;i++)
	{
		if(n%i==0)
		{
			if(i%2==1||(n/i)%2==1)
			{
				return true;
			}
		}
	}
	return false;
}*/
l power(l a,l b)
{
	l ans=1;
	while(b>0)
	{
		if(b&1)
		{
			ans=(ans*a)%mod;
		}
		b>>=1;
		a=(a*a)%mod;
	}
	return ans%mod;
}//prefixsums
l ncr(l n,l r,vector<l> fact)
{
	l ans=(fact[n]/((fact[n-r]*fact[r])%mod))%mod;
	return ans;
}
void frooty(l t)
{
	l n;
	cin>>n;
	vector<l> v;
	l ans=0;
	l maxx=0;
	for(l i=0;i<n;i++)
	{
		l a;
		cin>>a;
		v.pb(a);
	}
	l maxx=v[0];
	for(l i=1;i<n;i++)
	{
		if(v[i]<maxx)
		{
			ans+=maxx-v[i];
		}
		else
			maxx=v[i];
	}
	cout<<ans<<"\n";
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int q=1;
	//cin>>q;
	//q++;
	for(int i=0;i<q;i++)
	{
		char c[]="anudeep";
		frooty(i+1);
	}
}

Compiler output:
a.cc: In function 'void frooty(long long int)':
a.cc:72:11: error: redeclaration of 'long long int maxx'
   72 |         l maxx=v[0];
      |           ^~~~
a.cc:65:11: note: 'long long int maxx' previously declared here
   65 |         l maxx=0;
      |           ^~~~
Language: Java

import java.util.Scanner;

public class Main4 {
	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;
		int i = 0;
		for (int j = i + 1; j < n; j++) {
			if (a[i] >= a[j]) {
				sum += a[i] - a[j];
			} else {
				i = j;
			}
		}
		System.out.println(sum);
		sc.close();
	
	}
}


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

import java.util.Scanner;

public class Main4 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long[] a = new long[n];
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextLong();
		}

		long sum = 0;
		int i = 0;
		for (int j = i + 1; j < n-1; j++) {
			if (a[i] >= a[j]) {
				sum += a[i] - a[j];
			} else {
				i = j;
			}
		}
		System.out.println(sum);
		sc.close();
	
	}
}

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

import java.util.Scanner;

public class Main4 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long[] a = new long[n];
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextLong();
		}

		long sum = 0;
		int i = 0;
		for (int j = i + 1; j < n; j++) {
			if (a[i] >= a[j]) {
				sum += a[i] - a[j];
			} else {
				i = j;
			}
		}
		System.out.println(sum);
		sc.close();
	
	}
}

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

import java.util.Scanner;

public class Main4 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long[] a = new long[n];
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextLong();
		}

		int sum = 0;
		int i = 0;
		for (int j = i + 1; j < n; j++) {
			if (a[i] >= a[j]) {
				sum += a[i] - a[j];
			} else {
				i = j;
			}
		}
		System.out.println(sum);
	}
}

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

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
			
			int N = sc.nextInt();
			int check = sc.nextInt();
			int tall = 0;
			long cnt = 0;
			
			
			for(int i=0;i<N-1;i++) {
				tall = sc.nextInt();
				if( tall<check) {
					cnt=cnt+(check-tall);
				}else {
					check=tall;
				}
			}
			
						
			System.out.println(cnt);
	}	
}

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

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

int main(){
    int N;
    scanf("%d%*c",&N);
    char *s = (char *)malloc(12 * N * sizeof(char));
    gets(s);
    long unsigned int max = 0;
    long unsigned int sum = 0;
    for(int i = 0;i < N; i++){
        int n;
        long unsigned int a;
        sscanf(s,"%ld %n",&a,&n);
        if(max < a)max = a;
        sum += max - a;
        s = &s[n];
    }
    printf("%ld\n",sum);
    return 0;
}g

Compiler output:
main.c: In function 'main':
main.c:8:5: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    8 |     gets(s);
      |     ^~~~
      |     fgets
main.c: At top level:
main.c:21:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input
   21 | }g
      | ^