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

#include <bits/stdc++.h>
using namespace std;
 
#define ll long long
#define ld long double
 
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
 
template <typename T> using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
 
string to_string(char c) {
	return string(1, c);
}
string to_string(bool b) {
	return b ? "true" : "false";
}
string to_string(const char* s) {
	return string(s);
}
string to_string(string s) {
	return s;
}
string to_string(vector<bool> v) {
	string res;
	for(int i = 0; i < (int) v.size(); i++)
		res += char('0' + v[i]);
	return res;
}
 
template<size_t S> string to_string(bitset<S> b) {
	string res;
	for(int i = 0; i < S; i++)
		res += char('0' + b[i]);
	return res;
}

template<class T> string to_string(T v) {
    bool f = 1;
    string res;
    for(auto& x : v) {
		if(!f)
			res += ' ';
		f = 0;
		res += to_string(x);
	}
    return res;
}
 
void DBG() {
	cerr << "]" << endl;
}

template<class H, class... T> void DBG(H h, T... t) {
	cerr << to_string(h);
	if(sizeof...(t))
		cerr << ", ";
	DBG(t...);
}

#ifdef _DEBUG
#define dbg(...) cerr << "LINE(" << __LINE__ << ") -> [" << #__VA_ARGS__ << "]: [", DBG(__VA_ARGS__)
#else
#define dbg(...) 0
#endif

const int d4i[4] = {-1, 0, 1, 0}, d4j[4] = {0, 1, 0, -1};
const int d8i[8] = {-1, -1, 0, 1, 1, 1, 0, -1}, d8j[8] = {0, 1, 1, 1, 0, -1, -1, -1};

void solve() {
	string s = "31415926535897932384626433832795028841971693993751058209749445923078164062862089986280";
	cin >> s;
	int sm = 0;
	for(int i = 0; i < (int)s.size(); i++){
		sm += s[i] - '0';
	}
	cout << (sm % 9 == 0 ? "Yes":"No") << '\n';
}	
 
int main() {
	
	ios::sync_with_stdio(0);
	cin.tie(0);
 	
	int t = 1;
	//cin >> t;
	for(int i = 1; i <= t; i++) {
		//cout << "Case #" << i << ": ";
		solve();
	}
}

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++

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
#define nt _int128
#define mod 1000000007
int main()
{
#ifndef ONLINE_JUDGE
   	freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t;
    // cin >> t;
    t  = 1;
    while(t--)
    {
    	string s;
    	cin>>s;
    	ll ans=0;
    	for(ll i=0;i<s.size();i++)
    	{
    		ans+=(s[i]-'0');
    	}
    	if(ans%9)
    		cout<<"No";;
    	else
    		cout<<"Yes";
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:9: error: 'else' without a previous 'if'
   30 |         else
      |         ^~~~
Language: C

#include<bits/stdc++.h>
using namespace std;
int read(){
	int x;scanf("%d",&x);return x;
}
char ch[2001020];
int ans = 0;
int main()
{
	cin>>ch;
	int L = strlen(ch);
	for(int i = 0;i < L;i++) {
		ans += (int)(ch[i]-'0');
		ans %= 9;
	}
	ans!=0?cout << "No" << endl:cout << "Yes" << endl;
	return 0;
}

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

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


using namespace std;

int ctoi(char c) {

	switch (c)
	{
	case'0':
		return 0;
	case'1':
		return 1;
	case'2':
		return 2;
	case'3':
		return 3;
	case'4':
		return 4;
	case'5':
		return 5;
	case'6':
		return 6;
	case'7':
		return 7;
	case'8':
		return 8;
	case'9':
		return 9;
	default:
		break;
	};
}
using ull = unsigned long long;
using ll =long long;

void main() {

	string s;
	cin >> s;
	unsigned long long sum = 0;
	for (char& c : s) {
		sum += ctoi(c);
	}
	cout << ((sum % 9 == 0) ? "Yes" : "No") << endl;
}

Compiler output:
a.cc:40:1: error: '::main' must return 'int'
   40 | void main() {
      | ^~~~
a.cc: In function 'int ctoi(char)':
a.cc:36:1: warning: control reaches end of non-void function [-Wreturn-type]
   36 | }
      | ^
Language: C++

#include <bits/stdc++.h>

/*                          
---------------------------------------------------------------
Aditya Kumar mishra
---------------------------------------------------------------
*/

#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define ins insert
#define mp make_pair
#define len(s) s.length()
#define forp(i, a, b) for (int i = a; i <= b; i++)
#define rep(i, n) for (int i = 0; i < n; i++)
#define ren(i, n) for (int i = n - 1; i >= 0; i--)
#define forn(i, a, b) for (int i = a; i >= b; i--)
#define on cout << endl
#define o2(a, b) cout << a << " " << b
#define os cout << " "
#define all(v) v.begin(), v.end()
#define mem(n, m) memset(n, m, sizeof(n))
#define pii pair<int, int>
#define pll pair<long long, long long>
#define sii set<int>
#define us unordered_set<int>
#define um unordered_map<int, int>
#define sll set<long long>
#define vii vector<int>
#define vll vector<long long>
#define mll map<long long, long long>
#define lob lower_bound
#define upb upper_bound
#define ret return 0
#define present(s, x) (s.find(x) != s.end())
#define cpresent(s, x) (find(all(s), x) != s.end())
#define ford(container, it) for (__typeof(container.begin()) it = container.begin(); it != container.end(); it++)
#define fors(container, it, a, b) for (__typeof(container.begin()) it = a; it != b; it++)

#define boost ios_base::sync_with_stdio(0)
#define MOD 1000000007
#define EPSILON 1e-9
#define PI 3.14159265358979323846
#define inf 999999999999999999
#define siz 100001
#define SIZ 1000001
#define SIZE 200001

typedef long long ll;
typedef long double ldo;
typedef double db;
using namespace std;
#define pqb priority_queue<int>
#define pqs priority_queue<int, vi, greater<int>>
#define setbits(x) __builtin_popcountll(x)
#define zrobits(x) __builtin_ctzll(x)
#define w(x)  \
    int x;    \
    cin >> x; \
    while (x--)

void c_p_c()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}
int main()
{
    c_p_c();
    string s;
    cin >> s;
    ll sum = 0;
    for (int i = 0; i < (int)lens(s); i++)
    {
        sum += s[i] - '0';
    }
    if (sum % 9 == 0 || sum==0)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:80:30: error: 'lens' was not declared in this scope; did you mean 'len'?
   80 |     for (int i = 0; i < (int)lens(s); i++)
      |                              ^~~~
      |                              len
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int64_t n;
  cin>>n;
  while(n!=0){
    int x=0;
    x+=n%10;
    n/=10;
  }
  if(x%9==0){cout<<"Yes"<<endl;}
  else {cout<<"No"<<endl;}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:6: error: 'x' was not declared in this scope
   11 |   if(x%9==0){cout<<"Yes"<<endl;}
      |      ^
Language: C++

#pragma GCC optimize ("Ofast")
#pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include "bits/stdc++.h"
using namespace std;
#define ll long long
#define pb push_back
#define all(_obj) _obj.begin(),_obj.end()
#define F first
#define S second
#define INF 1e18
#define pll pair<ll, ll> 
#define vll vector<ll>
ll n,m,a,b,c,k,temp,x,y;
const int MAXN=1e5+11,mod=1e9+7;
inline ll max(ll a,ll b) {return ((a>b)?a:b);}
inline ll min(ll a,ll b) {return ((a>b)?b:a);}
inline vll read(int n) {vll v(n);for (int i = 0; i < v.size(); i++)cin>>v[i];return v;}
void sol()
{
string s;
cin>>s;
ll sum=0;
for(int i=0;i<s.size();i++)
{
    sum+=s[i]-'0';
}
if(sum%9)
cout<<"No";
else
cout<<"Yes";


return ;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int test=1;
    //cin>>test;
    for(int i=1;i<=test;i++)
    sol();
}


Compiler output:
In file included from /usr/include/c++/14/string:43,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:3:
/usr/include/c++/14/bits/allocator.h: In destructor 'std::__cxx11::basic_string<char>::_Alloc_hider::~_Alloc_hider()':
/usr/include/c++/14/bits/allocator.h:182:7: error: inlining failed in call to 'always_inline' 'std::allocator< <template-parameter-1-1> >::~allocator() noexcept [with _Tp = char]': target specific option mismatch
  182 |       ~allocator() _GLIBCXX_NOTHROW { }
      |       ^
In file included from /usr/include/c++/14/string:54:
/usr/include/c++/14/bits/basic_string.h:186:14: note: called from here
  186 |       struct _Alloc_hider : allocator_type // TODO check __is_final
      |              ^~~~~~~~~~~~
Language: C++

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

bool check(string n){
  int l = n.length();
  int ans = 0;
  for(int i=0;i<l;i++) ans+=n[i]-'0';
  if(ans%9==0)return true;
  return false;
}
int main(){

string n;
  cin>>n;
  if(check(n)) cout<<"Yes";
  else cout<<"No";
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

using namespace std;

int main(){

    string N;

    cin>>N;

    long long cnt=0;

    for(int i=0;i<N.length();i++){
        cnt+=(N[i]-'0');    
    }

    if(cnt%9==0){
        cout<<"Yes"<<endl;
    }else{
        cout<<"No"<<endl;
    }
    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'string' was not declared in this scope
    5 |     string N;
      |     ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | using namespace std;
a.cc:7:5: error: 'cin' was not declared in this scope
    7 |     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:7:10: error: 'N' was not declared in this scope
    7 |     cin>>N;
      |          ^
a.cc:16:9: error: 'cout' was not declared in this scope
   16 |         cout<<"Yes"<<endl;
      |         ^~~~
a.cc:16:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:16:22: error: 'endl' was not declared in this scope
   16 |         cout<<"Yes"<<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;
a.cc:18:9: error: 'cout' was not declared in this scope
   18 |         cout<<"No"<<endl;
      |         ^~~~
a.cc:18:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:18:21: error: 'endl' was not declared in this scope
   18 |         cout<<"No"<<endl;
      |                     ^~~~
a.cc:18:21: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const long long INF = 9999999999999999;
using ll = long long;
int main(){
  string s;
  cin>>s;
  int ans = 0;
  for(int i = 0;i<s.size();i++){
    string p = s.at(i);
    int q = atoi(p);
    ans += q;
  }
  if(ans%9 == 0){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
  return 0;
}
    
    

Compiler output:
a.cc: In function 'int main()':
a.cc:11:20: error: conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   11 |     string p = s.at(i);
      |                ~~~~^~~
a.cc:12:18: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   12 |     int q = atoi(p);
      |                  ^
      |                  |
      |                  std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42,
                 from a.cc:1:
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
Language: C++

#include <bits/stdc++.h>
#define ll long long 
#define  ff first
#define ss second
#define vi vector<int>
#define vl vector<ll>
#define vll vector<pair<ll,ll> >
#define vii vector<pair<int,int> >
#define pb push_back
#define inf 1000000007
#define f(i,a,b) for(i=a;i<b;i++)

using namespace std;
bool cmp(string &a,string &b)
{
	if(a.size()==b.size())return a<b;
	return a.size()<b.size();
}

int main()
{ 
 string s;
 cin>>s;
 ll n,sm=0;
 n=s.size();
 
 f(i,0,n)
 {
     sm+=(s[i]-'0');
 }
 if(sm%9==0)cout<<"Yes";
 else cout<<"No";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:4: error: 'i' was not declared in this scope
   27 |  f(i,0,n)
      |    ^
a.cc:11:22: note: in definition of macro 'f'
   11 | #define f(i,a,b) for(i=a;i<b;i++)
      |                      ^
Language: C++

#include<bits/stdc++.h>
#define SaveTime ios_base::sync_with_stdio(false);cin.tie(0);
#define MOD 1e9+7
#define ll long long
#define ull unsigned long long
#define pb push_back
#define PI 4*atan(1)

using namespace std;

int main()
{
   string s; cin >> s;
   for (int i = 0; i < s.lenght(); i++) {
      sum+= s[i]-'0';
   }
   if (sum % 9 == 0)
      cout << "Yes";
   else
      cout << "No";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:26: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'lenght'; did you mean 'length'?
   14 |    for (int i = 0; i < s.lenght(); i++) {
      |                          ^~~~~~
      |                          length
a.cc:15:7: error: 'sum' was not declared in this scope
   15 |       sum+= s[i]-'0';
      |       ^~~
a.cc:17:8: error: 'sum' was not declared in this scope
   17 |    if (sum % 9 == 0)
      |        ^~~
Language: C++

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

using namespace std;
 
#define pb push_back
#define mp make_pair
#define f first
#define s second
 
#define all(s) s.begin(),s.end()
#define spresent(s,v) ((s).find(v)!=s.end())
#define present(s,v) (find(all(s),v)!=s.end())
 
#define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL)
 
#define fill_1d(a,val) fill(a,a+sizeof(a)/sizeof(a[0]),val)
#define fill_2d(a,val) fill(&a[0][0],&a[0][0]+sizeof(a)/sizeof(a[0][0]),val)
#define fill_nd(a,p2f,val) fill(p2f,p2f+sizeof(a)/sizeof(*p2f),val)
 
#define deb(x) cout<<#x<<" = "<<x<<endl
#define dout(i,s) cout<<"Case #"<<i<<": "<<s<<"\n"
#define hout(i) cout<<"Case #"<<i<<": "

#define For(a,n) for(int i=a; (a<n?i<n:i>n) ; (a<n?++i:--i))
 
typedef long long int ll;
typedef pair<int,int> pi;
typedef pair<double,double> pd;
typedef pair<ll,ll> pl;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
 
typedef struct node{
	ll val,more=0,less=0;
	bool operator <(const node& a){
		return val<a.val;
	}
}node;

struct House{
	int start, end, height;
};
ostream& operator << (ostream &os, const House &s) {
	return (os << "Start: " << s.start << ", End: " << s.end << ", Height: " << s.height);
}

struct Segment{
	int start, end, height;
	ll perimeter;
};
ostream& operator << (ostream &os, const Segment &s) {
	return (os << "Start: " << s.start << ", End: " << s.end << ", Height: " << s.height << ", Perimeter: " << s.perimeter);
}
bool operator <(const Segment& x, const Segment& y) {
    return x.start < y.start;
}



const int N = 50;
const int MOD = 1e9+7;



void solve(){


}


int main() {

	string n;

	ll sum =0;

	cin>>n;
	int sz = n.length();
	for(int i=0;i<sz;++i) {
		sum+=s[i]-'0';
	}

	if(sum%9==0)
		cout<<"Yes";
	else
		cout<<"No";








	return 0;
}





Compiler output:
a.cc: In function 'int main()':
a.cc:9:11: error: 'second' was not declared in this scope
    9 | #define s second
      |           ^~~~~~
a.cc:83:22: note: in expansion of macro 's'
   83 |                 sum+=s[i]-'0';
      |                      ^
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define vll vector<ll>
#define vi vector<int>
#define vvll vector<vll>
#define wh(t) while(t--)
#define fi(n) for(ll i = 0; i < n; i++)
#define fj(n) for(ll j = 0; j < n; j++)
#define fu(i,s,e) for(ll i = s; i <=e; i++)
#define fd(i,s,e) for(ll i = s; i >=e; i--)
#define mp make_pair
#define pb push_back
#define pii pair<int, int>
#define pll pair<ll,ll>
#define vpll vector<pll>
#define fr first
#define se second
#define sll stack<ll>
#define qll queue<ll>
using namespace std;
const ll M = 1e9+7;
//const ll M = 998244353;

ll pmp(ll x,ll n){ll a = 1;while(n > 0){if(n & 1) a = (a * x)%M;x = (x * x)%M;n = n>>1;}return a;}

void solve(){
	string s;
	cin >> s;
	ll sum = 0;
	for(auto x:s)
		sum+=(x-'0');
	if(sum%9)
		cout << "No\n";
	else
		cout <, "Yes\n";
}

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	#ifndef ONLINE_JUDGE
	//freopen("input.txt", "r", stdin);
	#endif
	ll t;
	t = 1;
	//cin >> t;
	wh(t){
		solve();
	}
	cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
	return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:36:23: error: expected primary-expression before ',' token
   36 |                 cout <, "Yes\n";
      |                       ^
Language: C++

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

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define eb emplace_back

using ll = long long;
using vll = vector<ll>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using P = pair<int, int>;

void Main(){
    string s; cin >> s;
    int tot = 0;
    rep(i, s.size()){
        tot += (s[i] - '0');
        tot % = 9;
    }
    puts(tot % 9 == 0 ? "Yes" : "No");
    return;
}

int main(){
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();
    return 0;
}

Compiler output:
a.cc: In function 'void Main()':
a.cc:25:15: error: expected primary-expression before '=' token
   25 |         tot % = 9;
      |               ^
Language: C++

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

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define eb emplace_back

using ll = long long;
using vll = vector<ll>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using P = pair<int, int>;

void Main(){
    string s; cin >> s;
    int tot = 0;
    rep(i, s.size()){
        tot += (s[i] - '0');
        tot % = 0;
    }
    puts(tot % 9 == 0 ? "Yes" : "No");
    return;
}

int main(){
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();
    return 0;
}

Compiler output:
a.cc: In function 'void Main()':
a.cc:25:15: error: expected primary-expression before '=' token
   25 |         tot % = 0;
      |               ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
 
int main() {

  ll n;
  cin>>n;
  vector<ll> a;
  rep(i,n){
    cin>>a[i];
  }
  ll ans=0;
  rep(i,n){
  if(x[i]>x[i+1]){
    ans+=x[i]-x[i+1];
    x[i]=x[i+1];
  }
    else{
      continue;
    }
  }
    
  cout<<ans<<endl;
}

  

Compiler output:
a.cc: In function 'int main()':
a.cc:16:6: error: 'x' was not declared in this scope
   16 |   if(x[i]>x[i+1]){
      |      ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int M = 1000000007;
ll mod(ll x){
        return ((x%M + M)%M);
    }
ll add(ll a, ll b){
        return mod(mod(a)+mod(b));
    }
ll mul(ll a, ll b){
        return mod(mod(a)*mod(b));
    }
ll minu(ll a, ll b){
        return mod(mod(a)-mod(b));
    }
ll power(ll a, ll b){
    ll res=1;
    while(b>0){
        if(b&1) res=mul(res,a);
        b = b>>1;
        a=mul(a,a);
    }
    return res;
}
int main(){
    ll n;
    cin>>n;
    int a[n];
    ll s=0;
    for(ll i=0;i<n;++i){
        cin>>a[i];
    }
    ll ans=0;
    for(int i=0;i<n;i++){
        s=max(s,a[i]);
        ans+=s-a[i];
    }
    cout<<ans;
    return 0;
}

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

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

int	max(int a, int b)
{
	return ((a > b) ? a : b);
}

int	main(void)
{
	int	N;
	int	*A, *B;
	int	res = 0;
	int	m = 0;
	int	i;

	scanf("%d", &N);
	A = malloc(sizeof(int) * N);
	for (i = 0; i < N; i++)
		scanf("%d", &A[i]);
	B = malloc(sizeof(int) * (N - 1));
	for (i = 0; i < N - 1; i++)
	{
		m = max(max(A[i], A[i + 1]), m);
		if (m > A[i + 1])
			B[i] = m - A[i + 1];
		else
			B[i] = 0;
	}
	for (i = 0; i < N - 1; i++)
		res += B[i];
	printf("%d\n", res);
	free(a);
	free(b);
	return (0);
}

Compiler output:
main.c: In function 'main':
main.c:33:14: error: 'a' undeclared (first use in this function)
   33 |         free(a);
      |              ^
main.c:33:14: note: each undeclared identifier is reported only once for each function it appears in
main.c:34:14: error: 'b' undeclared (first use in this function)
   34 |         free(b);
      |              ^
Language: C++

#include<iostream>
using namespace std;

int main(){
  int n;
  cin>>n;
  int a[n];
  int i;
  
  for(i=0;i<n;i++)
    cin>>a[i];
  int stools= 0;
  int diff;
  int maxi=0;
 for(i=1;i<n;i++)
 {
   maxi = max(maxi,a[i]);
     diff = (maxi-a[i]); 
    stools+=diff;
     a[i] += diff;
   }
 }
  cout<<stools;
  
  
  
 return 0; 
}


Compiler output:
a.cc:23:3: error: 'cout' does not name a type
   23 |   cout<<stools;
      |   ^~~~
a.cc:27:2: error: expected unqualified-id before 'return'
   27 |  return 0;
      |  ^~~~~~
a.cc:28:1: error: expected declaration before '}' token
   28 | }
      | ^
Language: C++

#inclue<iostream>
using namespace std;

int main(){
  int n;
  cin>>n;
  int a[n];
  int i;
  
  for(i=0;i<n;i++)
    cin>>a[i];
  int stools= 0;
  int diff;
 for(i=1;i<n;i++)
 {
   if(a[i-1]>a[i]){
     diff = (a[i-1]-a[i]); 
    stools+=diff;
     a[i] += diff;
   }
 }
  
  
  cout<<stools;
  
 return 0; 
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inclue; did you mean #include?
    1 | #inclue<iostream>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   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 | #inclue<iostream>
a.cc:24:3: error: 'cout' was not declared in this scope
   24 |   cout<<stools;
      |   ^~~~
a.cc:24:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include<iostream>
#include<stdio.h>
using namespace std;
#include<algorithm>
#include<set>
#include<vector>
#define rep(i,n) for(int i=0;i<(n);i++)

const int mod=1000000007;


int main(){
int N;
  cin>>N;
  vector<int>a(N);
    int sum=0;
  rep(i,N)cin>>a[i];
  rep(i,N){
    int ma=-100;
  
    ma=max(ma,a[i]);
    if(max!=a[i])sum=sum+(max-a[i]);
  }
  cout<<sum<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22: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!='
   22 |     if(max!=a[i])sum=sum+(max-a[i]);
a.cc:22:30: 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-'
   22 |     if(max!=a[i])sum=sum+(max-a[i]);
Language: C++

#include<iostream>
#include<stdio.h>
using namespace std;
#include<algorithm>
#include<set>
#include<vector>
#define rep(i,n) for(int i=0;i<(n);i++)

const int mod=1000000007;


int main(){
int N;
  cin>>N;
  vector<int>a(N);
    int sum=0;
  rep(i,N)cin>>a[i];
  rep(i,N){
    int max=-100;
  
    max=max(max,a[i]);
    if(max!=a[i])sum=sum+(max-a[i]);
  }
  cout<<sum<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:12: error: 'max' cannot be used as a function
   21 |     max=max(max,a[i]);
      |         ~~~^~~~~~~~~~
Language: C++

#include<iostream>
#include<stdio.h>
using namespace std;
#include<algorithm>
#include<set>
#include<vector>
#define rep(i,n) for(int i=0;i<(n);i++)

const int mod=1000000007;


int main(){
int N;
  cin>>N;
  vector<int>a(N);
  rep(i,N)cin>>a[i];
  rep(i,N){
    int max=-100;
    int sum=0;
    max=max(max,a[i]);
    if(max!=a[i])sum=sum+(max-a[i]);
  }
  cout<<sum<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:12: error: 'max' cannot be used as a function
   20 |     max=max(max,a[i]);
      |         ~~~^~~~~~~~~~
a.cc:23:9: error: 'sum' was not declared in this scope
   23 |   cout<<sum<<endl;
      |         ^~~
Language: C++

#include<iostream>
#include<stdio.h>
using namespace std;
#include<algorithm>
#include<set>
#include<vector>
#define rep(i,n) for(int i=0;i<(n);i++)

const int mod=1000000007;


int main(){
int N;
  cin>>N;
  vector<int>a(N);
  rep(i,N)cin>>a[i];
  rep(i,N){
    int max=-100;
    int sum=0;
    max=max(max,A[i]);
    if(max!=A[i])sum=sum+(max-A[i]);
  }
  cout<<sum<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:17: error: 'A' was not declared in this scope
   20 |     max=max(max,A[i]);
      |                 ^
a.cc:20:21: error: 'max' cannot be used as a function
   20 |     max=max(max,A[i]);
      |                     ^
a.cc:23:9: error: 'sum' was not declared in this scope
   23 |   cout<<sum<<endl;
      |         ^~~
Language: C++

#include<iostream>
#include<stdio.h>
using namespace std;
#include<algorithm>
#include<set>
#include<vector>
#define rep(i,n) for(int i=0;i<(n);i++)

const int mod=1000000007;


int main
int N;
  cin>>N;
  vector<int>a(N);
  rep(i,N)cin>>a[i];
  rep(i,N){
    int max=-100;
    int sum=0;
    max=max(max,A[i]);
    if(max!=A[i])sum=sum+(max-A[i]);
  }
  cout<<sum<<endl;
  return 0;
}

Compiler output:
a.cc:13:1: error: expected initializer before 'int'
   13 | int N;
      | ^~~
a.cc:14:3: error: 'cin' does not name a type
   14 |   cin>>N;
      |   ^~~
a.cc:15:16: error: 'N' was not declared in this scope
   15 |   vector<int>a(N);
      |                ^
a.cc:7:18: error: expected unqualified-id before 'for'
    7 | #define rep(i,n) for(int i=0;i<(n);i++)
      |                  ^~~
a.cc:16:3: note: in expansion of macro 'rep'
   16 |   rep(i,N)cin>>a[i];
      |   ^~~
a.cc:16:7: error: 'i' does not name a type
   16 |   rep(i,N)cin>>a[i];
      |       ^
a.cc:7:30: note: in definition of macro 'rep'
    7 | #define rep(i,n) for(int i=0;i<(n);i++)
      |                              ^
a.cc:16:7: error: 'i' does not name a type
   16 |   rep(i,N)cin>>a[i];
      |       ^
a.cc:7:36: note: in definition of macro 'rep'
    7 | #define rep(i,n) for(int i=0;i<(n);i++)
      |                                    ^
a.cc:7:18: error: expected unqualified-id before 'for'
    7 | #define rep(i,n) for(int i=0;i<(n);i++)
      |                  ^~~
a.cc:17:3: note: in expansion of macro 'rep'
   17 |   rep(i,N){
      |   ^~~
a.cc:17:7: error: 'i' does not name a type
   17 |   rep(i,N){
      |       ^
a.cc:7:30: note: in definition of macro 'rep'
    7 | #define rep(i,n) for(int i=0;i<(n);i++)
      |                              ^
a.cc:17:7: error: 'i' does not name a type
   17 |   rep(i,N){
      |       ^
a.cc:7:36: note: in definition of macro 'rep'
    7 | #define rep(i,n) for(int i=0;i<(n);i++)
      |                                    ^
a.cc:23:3: error: 'cout' does not name a type
   23 |   cout<<sum<<endl;
      |   ^~~~
a.cc:24:3: error: expected unqualified-id before 'return'
   24 |   return 0;
      |   ^~~~~~
a.cc:25:1: error: expected declaration before '}' token
   25 | }
      | ^
Language: C++

#include<iostream>
#include<stdio.h>
using namespace std;
#include<algorithm>
#include<set>
#include<vector>
#define rep(i,n) for(int i=0;i<(n);i++)

const int mod=1000000007;


int main(){
  cin>>N;
  vector<int>a(N);
  rep(i,N)cin>>a[i];
  rep(i,N){
    int max=-100;
    int sum=0;
    max=max(max,A[i]);
    if(max!=A[i])sum=sum+(max-A[i]);
  }
  cout<<sum<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:8: error: 'N' was not declared in this scope
   13 |   cin>>N;
      |        ^
a.cc:19:17: error: 'A' was not declared in this scope
   19 |     max=max(max,A[i]);
      |                 ^
a.cc:19:21: error: 'max' cannot be used as a function
   19 |     max=max(max,A[i]);
      |                     ^
a.cc:22:9: error: 'sum' was not declared in this scope
   22 |   cout<<sum<<endl;
      |         ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); i++)
using ll = long long;

int main() {
	int n; cin >> n;
    ll ans = 0;
    ll high = 0;
  rep(i, n){
    ll a; cin >> a;
    ans += max(high - a, 0);
    high = max(a, high);
  }
  
  cout << ans << endl;
   return 0;
}


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

#include<iostream>
using namespace std;

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: expected initializer before 'ans'
    7 |     long longs ans = 0,a[n];
      |                ^~~
a.cc:9:16: error: 'a' was not declared in this scope
    9 |         cin >> a[i];
      |                ^
a.cc:12:12: error: 'a' was not declared in this scope
   12 |         if(a[i] < a[i - 1]){
      |            ^
a.cc:14:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   14 |             ans += a[i - 1] - a[i];
      |             ^~~
      |             abs
a.cc:19:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   19 |     cout << ans << endl;
      |             ^~~
      |             abs
Language: C++

#include"bits/stdc++.h"
using namespace std;
int main() {
  int 64_t N,ans=0;
  cin>>N;
  vector<int> A(N);
  vector<int> B(N-1);
  for(int i =0;i<N;i++){
    cin>>A[i];
  }
  for(int k =1;k<N;k++){
    if(A[k]<A[k-1]){
      B[k-1]=A[k-1]-A[k];
      A[k]=A[k-1];
      ans+=B[k-1];
    }
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:7: error: expected unqualified-id before numeric constant
    4 |   int 64_t N,ans=0;
      |       ^~~~
a.cc:5:8: error: 'N' was not declared in this scope
    5 |   cin>>N;
      |        ^
a.cc:15:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
   15 |       ans+=B[k-1];
      |       ^~~
      |       abs
a.cc:18:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   18 |   cout<<ans<<endl;
      |         ^~~
      |         abs
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: 'inti' was not declared in this scope; did you mean 'int'?
    9 |   for(inti=0;i<n;++i) cin >> a[i];
      |       ^~~~
      |       int
a.cc:9:14: error: 'i' was not declared in this scope
    9 |   for(inti=0;i<n;++i) cin >> a[i];
      |              ^
Language: C++

#include <bits/stdc++.h>
int main() {
  int n; cin >> n;
  int prev = 0;
  long long res = 0;
  for (int i = 0; i < n; ++i) {
    int t; std::cin >> t;
    if (t > prev) res += t - prev;
    prev = t;
  }
  std::cout << res;
}

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
      |                  ^~~
Language: C++

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

int main(){
  int N,k,sum=0;
  cin >> N;
  cout << endl;
  vector<int> length(N);
  
  for(int i=0; i<N; i++)
    cin >> length(i);
  
  for(int j=0; j<N-1; j++){
    if(length.at(j)>length(j+1)){
      k=length(j+1);
      length(j+1)=length(j);
      sum += length(j)-k;
    }
  }
  
  cout << sum << endl;
  
}
      
    
    
  

Compiler output:
a.cc: In function 'int main()':
a.cc:11:18: error: no match for call to '(std::vector<int>) (int&)'
   11 |     cin >> length(i);
      |            ~~~~~~^~~
a.cc:14:27: error: no match for call to '(std::vector<int>) (int)'
   14 |     if(length.at(j)>length(j+1)){
      |                     ~~~~~~^~~~~
a.cc:15:15: error: no match for call to '(std::vector<int>) (int)'
   15 |       k=length(j+1);
      |         ~~~~~~^~~~~
a.cc:16:13: error: no match for call to '(std::vector<int>) (int)'
   16 |       length(j+1)=length(j);
      |       ~~~~~~^~~~~
a.cc:16:25: error: no match for call to '(std::vector<int>) (int&)'
   16 |       length(j+1)=length(j);
      |                   ~~~~~~^~~
a.cc:17:20: error: no match for call to '(std::vector<int>) (int&)'
   17 |       sum += length(j)-k;
      |              ~~~~~~^~~
Language: C++

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

int main()
{
	int n,s=0;
	cin>>n;
	int maxh,m;
	cin>>m;
	maxh=m;
	for(int i=1;i<n;i++)
	{
		int x;
		cin>>x;
		if(x<maxh)
			s+=maxh-x;
		else
			maxh=x;
	}
	cout<<x;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:15: error: 'x' was not declared in this scope
   20 |         cout<<x;
      |               ^
Language: Java

import java.util.ArrayList;
import java.util.Scanner;

public class ABC176C {
	public static void main(String args[]) {
		Scanner stdIn = new Scanner(System.in);
		int N = stdIn.nextInt();
		ArrayList<Integer> A = new ArrayList<Integer>();
		for(int i = 0; i < N; i ++) {
			A.add(stdIn.nextInt());
		}
		
		long stepSum = 0;
		
		for(int i = 1; i < N; i ++) {
			if(A.get(i - 1) <= A.get(i)) {
				continue;
			}else {
				stepSum += A.get(i - 1) - A.get(i);
				A.set(i, A.get(i - 1));
			}
		}
		
		System.out.println(stepSum);
	}
}

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

#include <bits//stdc++.h>
using namespace std;
#define int long long
#define M max
int main() {
    int A,N,Max=0;
    cin >> N;
    long long goukei=0;
    for(int i=0;i<N;i++){
        cin >> A;
        goukei+=M(Max-A,0);
        Max=max(A,Max);
    }
    cout << goukei << endl;
    
}



Compiler output:
cc1plus: error: '::main' must return 'int'
a.cc: In function 'int main()':
a.cc:11:18: error: no matching function for call to 'max(long long int, int)'
   11 |         goukei+=M(Max-A,0);
      |                  ^
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:18: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   11 |         goukei+=M(Max-A,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
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:18: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   11 |         goukei+=M(Max-A,0);
      |                  ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using p = pair<int, int>;
#define INF 1001001001
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repX(i, n ,x) for (int i = x; i < (int)(n); i++)
#define repBack(i, n) for (int i = n; i >= 0; i--)
#define dup(x,y) (((x)+(y)-1)/(y))

int main() {
	int N;
	cin >> N;
	vector<int> A(N);
	ll ans = 0;
	ll maxA = 0;
	rep(i,N){
		cin >> A[i];
		maxA = max(maxA,A[i]);
		ans = A[i] - maxA;
	}
	cout << ans << endl;
	

	return 0;
}


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

#include<iostream>
using namespace std;
int main()
{
    int n;
    cin >> n;
    vector<int> v(n);
    for(int i=0; i<n; i++){
        cin >> v[i];
    }
    long long cnt=0, maxi=max(v[0],v[1]);
    for(int i=1; i<n; i++){
        maxi = (v[i]>maxi) ? v[i] : maxi;
        if(v[i] >= v[i-1]) continue;
        else {
            cnt += (maxi-v[i]);
//            cout << cnt <<endl;
            v[i] = maxi;
        }
    }
    cout << cnt << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'vector' was not declared in this scope
    7 |     vector<int> v(n);
      |     ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:7:12: error: expected primary-expression before 'int'
    7 |     vector<int> v(n);
      |            ^~~
a.cc:9:16: error: 'v' was not declared in this scope
    9 |         cin >> v[i];
      |                ^
a.cc:11:31: error: 'v' was not declared in this scope
   11 |     long long cnt=0, maxi=max(v[0],v[1]);
      |                               ^
Language: C++

#include<iostream>
using namespace std;
int main()
{
    int n;
    cin >> n;
    vector<long long> v(n);
    for(int i=0; i<n; i++){
        cin >> v[i];
    }
    long long cnt=0, maxi=max(v[0],v[1]);
    for(int i=1; i<n; i++){
        maxi = (v[i]>maxi) ? v[i] : maxi;
        if(v[i] >= v[i-1]) continue;
        else {
            cnt += (maxi-v[i]);
//            cout << cnt <<endl;
            v[i] = maxi;
        }
    }
    cout << cnt << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'vector' was not declared in this scope
    7 |     vector<long long> v(n);
      |     ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:7:12: error: expected primary-expression before 'long'
    7 |     vector<long long> v(n);
      |            ^~~~
a.cc:9:16: error: 'v' was not declared in this scope
    9 |         cin >> v[i];
      |                ^
a.cc:11:31: error: 'v' was not declared in this scope
   11 |     long long cnt=0, maxi=max(v[0],v[1]);
      |                               ^
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main()
{

    ifstream read("input.txt");

    int n = 0, a = 0, sum = 0;
    
    vector<int> persoane;

    cin >> n;

    for (int i = 0; i < n; i++) {
        cin >> a;
        persoane.push_back(a);
    }
    for (int i = 0; i < n-1; i++) {
        if (persoane[i] <= persoane[i + 1]) {
            sum += 0;
        }
        else {
            sum += (persoane[i] - persoane[i + 1]);
            persoane[i + 1] = persoane[i];
        }
    }
    cout << sum;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: variable 'std::ifstream read' has initializer but incomplete type
    9 |     ifstream read("input.txt");
      |                  ^
a.cc:3:1: note: 'std::ifstream' is defined in header '<fstream>'; this is probably fixable by adding '#include <fstream>'
    2 | #include <vector>
  +++ |+#include <fstream>
    3 |
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main () {
  int n;
  cin >> n;
  
  vector<int> a(n);
  for (auto i = 0; i < n; i++) cin >> a[i];
  
  int acc = 0;
  int min = 0;
  
  for (const auto num : a) {
    if (min > num) {
      acc += min - num
    } else {
      min = num
    }
  }
  
  cout << acc << endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:23: error: expected ';' before '}' token
   18 |       acc += min - num
      |                       ^
      |                       ;
   19 |     } else {
      |     ~                  
a.cc:20:16: error: expected ';' before '}' token
   20 |       min = num
      |                ^
      |                ;
   21 |     }
      |     ~