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

#include<iostream>
#include<vector>
 
using namespace std;
int main(){
  int N;
  cin>>N;
  int n;
  vector<int> v;
  while(cin>>n){
  v.push_back(n)
    //処理
  }
  long long int x=1;
  for(int i=0;i<N;i++){
   x=lcm(x,v[i]); 
  }
  x--;
  int f=0;
   for(int i=0;i<N;i++){
    f+=x%v[i];
  }
  cout << f <<endl;
  return 0;
}
 
 
long long int lcm( long long int m, int n )
{
	// 引数に０がある場合は０を返す
	if ( ( 0 == m ) || ( 0 == n ) )
		return 0;
	
	return ((m / gcd(m, n)) * n); // lcm = m * n / gcd(m,n)
}//lcm

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: expected ';' before '}' token
   11 |   v.push_back(n)
      |                 ^
      |                 ;
   12 |     //処理
   13 |   }
      |   ~              
a.cc:16:6: error: 'lcm' was not declared in this scope
   16 |    x=lcm(x,v[i]);
      |      ^~~
a.cc: In function 'long long int lcm(long long int, int)':
a.cc:34:22: error: 'gcd' was not declared in this scope
   34 |         return ((m / gcd(m, n)) * n); // lcm = m * n / gcd(m,n)
      |                      ^~~
Language: C++

#include<iostream>
#include<vector>

using namespace std;
int main(){
  cin>>N
  int n;
  vector<int> v;
  while(cin>>n){
  v.push_back(n)
    //処理
  }
  long long int x=1;
  for(int i=0;i<N;i++){
   x=lcm(x,v[i]); 
  }
  x--;
  int f=0;
   for(int i=0;i<N;i++){
    f+=x%v[i];
  }
  cout << f <<endl;
  return 0;
}


long long int lcm( long long int m, int n )
{
	// 引数に０がある場合は０を返す
	if ( ( 0 == m ) || ( 0 == n ) )
		return 0;
	
	return ((m / gcd(m, n)) * n); // lcm = m * n / gcd(m,n)
}//lcm

Compiler output:
a.cc: In function 'int main()':
a.cc:6:8: error: 'N' was not declared in this scope
    6 |   cin>>N
      |        ^
a.cc:9:14: error: 'n' was not declared in this scope
    9 |   while(cin>>n){
      |              ^
a.cc:15:6: error: 'lcm' was not declared in this scope
   15 |    x=lcm(x,v[i]);
      |      ^~~
a.cc: In function 'long long int lcm(long long int, int)':
a.cc:33:22: error: 'gcd' was not declared in this scope
   33 |         return ((m / gcd(m, n)) * n); // lcm = m * n / gcd(m,n)
      |                      ^~~
Language: C++

#include <bits/stdc++.h>

using namespace std;
#define pb push_back
#define LL long long
int main() {
    // freopen("in.txt","r",stdin);
   // freopen("out.txt","w",stdout);
    int T, x;
    //3
3 4 63
3 4 63
3 4 6
cin >> T;
   // while(T--) {
        int n, m;
        LL ans = 0;
        cin >> n;
        for(int i = 1; i <= n; ++i) {
            cin >> x;
            if(i != 1)
                ans += x;
        }
        cout << ans << "\n";
    //}

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:2: error: expected ';' before numeric constant
   11 | 3 4 63
      |  ^~
      |  ;
Language: C++

#include <iostream>
#include <vector>

int main()
{
  int N;
  std::cin >> N;
  std::vector<int> a(N);
  for (int i = 0; i < N; i++)
  {
     int x;
     std::cin >> x;
     a[i] = x - 1;
  }

  int sum = 0;
  for (auto it = a.begin(); it != a.end(); i++)
    sum += *it;

  std::cout << sum << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:44: error: 'i' was not declared in this scope; did you mean 'it'?
   17 |   for (auto it = a.begin(); it != a.end(); i++)
      |                                            ^
      |                                            it
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long LL;
typedef pair<int,int> P;
const LL mod=1e9+7;
const LL LINF=1LL<<62;




int main(){
    int N;
    cin >> N;
    int ans=0;
    for(int i=0;i<N;i++){
        int a;
        cin >> a:
        ans+=a-1;
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:17: error: found ':' in nested-name-specifier, expected '::'
   24 |         cin >> a:
      |                 ^
      |                 ::
a.cc:24:16: error: 'a' is not a class, namespace, or enumeration
   24 |         cin >> a:
      |                ^
Language: C

#include <cstdio>


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

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

#include <algorithm>
#include <vector>
#include <iostream>
#include <cstdio>
int gcd(int a, int b)
{

    if(b == 0) {
            return a;
    }
    else {
        return gcd(b, a % b);
    }
}
int lcm(int a,int b){
return a/gcd(a,b)*b;
}
int main(){
int n;
cin>>n;
int LCM=1;
vector<int>a(n);
for(int i=0;i<n;i++){
cin>>a[i];
LCM=lcm(LCM,a[i]);
}
int ans=-1;
for(int i=1;i<LCM;i++){
int sum=0;
for(int h=0;h<n;h++){
sum+=i%n;
}
ans=max(sum,ans);
}
cout<<ans<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   20 | cin>>n;
      | ^~~
      | std::cin
In file included from a.cc:3:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:22:1: error: 'vector' was not declared in this scope
   22 | vector<int>a(n);
      | ^~~~~~
a.cc:22:1: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:22:8: error: expected primary-expression before 'int'
   22 | vector<int>a(n);
      |        ^~~
a.cc:24:6: error: 'a' was not declared in this scope
   24 | cin>>a[i];
      |      ^
a.cc:33:5: error: 'max' was not declared in this scope; did you mean 'std::max'?
   33 | ans=max(sum,ans);
      |     ^~~
      |     std::max
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:1:
/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:35:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   35 | cout<<ans<<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:35:12: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   35 | cout<<ans<<endl;
      |            ^~~~
      |            std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (auto &x : a) cin >> x;
  cout << accumulate(begin(a), end(a), 0LL) - a.size() << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:11: error: 'accumulate' was not declared in this scope
   11 |   cout << accumulate(begin(a), end(a), 0LL) - a.size() << endl;
      |           ^~~~~~~~~~
Language: C

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


int main(){

    char S[100] = "a";
    char T[100] = "a";
    
    
    scanf("%s%s",S,T);
    
  

    for (i=1;i<N+1;i++) {
    scanf("%d",&a[i]);
    
        if (max < a[i]) {
            max = a[i];
        }
        
    }
    
    for (i=max+1;i<100000;i++) {
    //for (i=max+1;i<(max*2);i++) {
        
        for (j=1;j<N+1;j++) {
            sum = sum + (i%a[j]);
                  printf("あまりは%d\n",i%a[j]);
        }
        printf("%dの時、合計は%d\n",i ,sum);
        if (sumMax<sum) {
            sumMax = sum;
        }
        sum = 0;
    }

    printf("最大は%d\n",max);
    printf("%d\n",sumMax);
    
    
    return 0;
    
}


Compiler output:
main.c: In function 'main':
main.c:15:10: error: 'i' undeclared (first use in this function)
   15 |     for (i=1;i<N+1;i++) {
      |          ^
main.c:15:10: note: each undeclared identifier is reported only once for each function it appears in
main.c:15:16: error: 'N' undeclared (first use in this function)
   15 |     for (i=1;i<N+1;i++) {
      |                ^
main.c:16:17: error: 'a' undeclared (first use in this function)
   16 |     scanf("%d",&a[i]);
      |                 ^
main.c:18:13: error: 'max' undeclared (first use in this function)
   18 |         if (max < a[i]) {
      |             ^~~
main.c:27:14: error: 'j' undeclared (first use in this function)
   27 |         for (j=1;j<N+1;j++) {
      |              ^
main.c:28:13: error: 'sum' undeclared (first use in this function)
   28 |             sum = sum + (i%a[j]);
      |             ^~~
main.c:32:13: error: 'sumMax' undeclared (first use in this function)
   32 |         if (sumMax<sum) {
      |             ^~~~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
vector<int> vec;
int gcd(long long  a, int b)
{
	if (b == 0)
		return a;
	return gcd(b, a%b);
}

long long lcm(long long a, int b)
{
	return long long(a*b) / gcd(a, b);
}

int f(long long  m, int i)
{
	if (i == 0)
		return m%vec[i];
	return f(m, i - 1) + m%vec[i];
}

int main()
{
	int n;
	scanf("%d", &n);
	vec.resize(n);
	for (int i = 0; i < n; i++)
		scanf("%d", &vec[i]);
	long long lc = lcm(vec[0], vec[1]);
	for (int i = 2; i < vec.size(); i++)
	{
		lc = lcm(lc, vec[i]);
	}
	cout << f(lc-1, n - 1);
	return 0;
}

Compiler output:
a.cc: In function 'long long int lcm(long long int, int)':
a.cc:17:16: error: expected primary-expression before 'long'
   17 |         return long long(a*b) / gcd(a, b);
      |                ^~~~
a.cc:17:15: error: expected ';' before 'long'
   17 |         return long long(a*b) / gcd(a, b);
      |               ^~~~~
      |               ;
a.cc:17:16: error: expected primary-expression before 'long'
   17 |         return long long(a*b) / gcd(a, b);
      |                ^~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:36: error: 'sum' was not declared in this scope
    8 |   for(int i =0,a;i<N;i++){cin >> a;sum+= a-1;}
      |                                    ^~~
Language: C++

#include<stdio.h>
#include<cstdio>
using namespace std;

int main() {
  int N;
  cin >> N;
  int res = 0;
  for (int i=0 ; i<N ; i++) {
    int num;
    cin >> num;
    res += num - 1;
  }
  cout << res;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: 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<cstdio>
  +++ |+#include <iostream>
    3 | using namespace std;
a.cc:14:3: error: 'cout' was not declared in this scope
   14 |   cout << res;
      |   ^~~~
a.cc:14:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include <bits/stbc++.h>
using namespace std;
int main(){
	int n[3000],ans=0;
	cin>>n;
	for(int i=0;i<n;i++) {
		int x;
		cin>>x;
		ans+=x;
	}
	cout<<ans-n<<endl;
    return 0;
}



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

#include <bits/stdc++.h>
#define ll long long int

using namespace std;

int main()
{
  ll i, n, n, x, ans = 0;
  cin >> n;
  
  for(i=0; i<n; i++)
  {
    cin >> x;
    ans += x-1;
  }
  
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: redeclaration of 'long long int n'
    8 |   ll i, n, n, x, ans = 0;
      |            ^
a.cc:8:9: note: 'long long int n' previously declared here
    8 |   ll i, n, n, x, ans = 0;
      |         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  vector<int> a(3020);
  for(int i=0;i<N;i++){cin >> a.at(i);}
  int b=; 
  int c=N;
  for(int i=0;i<N;i++){
    b+=a.at(i)-1;
  }
  cout << b << endl;
}

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

// AtCoderC++.cpp : アプリケーションのエントリ ポイントを定義します。
//

#include "stdafx.h"
#include <algorithm>
#include <array>
#include <vector>
#include <iostream>
#include <string>
#include <functional>

using namespace std;


int main() {
	string key;
	getline(cin, key);
	const int n = atoi(key.c_str());
	int Mods = 0;
	int m;
	for (int i = 0; i < n; i++) {
		cin >> m;
		Mods += m - 1;
	}
	cout << Mods<<endl;
	return 0;
}






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

#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/math/common_factor_rt.hpp>

#define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++)
#define rep(x,to) for(int (x)=0;(x)<(to);(x)++)
#define repr(x,fr,to) for(int (x)=(fr);(x)>=(to);(x)--)
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()

using namespace std;
typedef long long ll; typedef vector<int> VI; typedef pair<int,int> pii;
typedef boost::multiprecision::cpp_int bigint;

const int mod = (int)1e9 + 7;
void dbg(){ cerr << "\n"; } template <typename T,typename ...T2>
void dbg(const T& fst, const T2&...rst){ cerr << fst << ": "; dbg(rst...); }


int main()
{
	
	//cin.tie(0); ios_base::sync_with_stdio(false);
	int n;
	cin >>n;
	VI a(n);
	rep(i,n) cin >>a[i];
	bigint bs = 1 , ans =0;
	rep(i, n) bs = boost::math::lcm(bs, a[i]);
	//dbg(bs);
	bigint tg = bs-1;
	rep(i, n) ans += tg % a[i];
	cout << ans <<"\n";
	return 0;
}


Compiler output:
a.cc:2:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
    2 | #include <boost/multiprecision/cpp_int.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
#include <algorithm>
#include <iostream>

typedef long long ll;
using namespace std;

int main(){
  string s,t;
  cin >>s >>t;
  for(int i=0;i<n;i++){
  	t=t[n-1]+t.substr(0,n-1);
  	if(t==s){
  		cout << "Yes" <<endl;
  		return;
  	}
  }
  cout << "No" <<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: 'n' was not declared in this scope
   11 |   for(int i=0;i<n;i++){
      |                 ^
a.cc:15:17: error: return-statement with no value, in function returning 'int' [-fpermissive]
   15 |                 return;
      |                 ^~~~~~
Language: C++

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

int main() {
    int n, num, ans = 0;
    cin >> n;
    rep(i, n) {
        cin >> num;
        ans += num-1;
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'i' was not declared in this scope
    7 |     rep(i, n) {
      |         ^
a.cc:7:5: error: 'rep' was not declared in this scope
    7 |     rep(i, n) {
      |     ^~~
Language: C++

#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <cmath>
#include <vector>
#include <queue>
#include <limits>
#include <algorithm>
#include <string>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
 
#define rep(i, N) for (int i = 0; i < N; i++)
#define pb push_back


mp::cpp_int gcd(mp::cpp_int x, mp::cpp_int y)
{
    mp::cpp_int r;

    while((r = x % y) != 0)
    {
        x = y;
        y = r;
    }
    return y;
}

mp::cpp_int lcm(mp::cpp_int x, mp::cpp_int y)
{
    return (x * y / gcd(x, y));
}

int main() {
    mp::cpp_int N;
    cin >> N;
    std::vector<mp::cpp_int> A(N);
    rep(i,N) cin >> A[i];
    mp::cpp_int tmp=lcm(A[0],A[1]);
    for(int i = 2; i < N;i++){
        tmp = lcm(tmp, A[i]);
    }
    cout << tmp << endl;
    tmp -= 1;
    mp::cpp_int ans=0;
    for(int i = 0; i < N;i++){
        ans += tmp % A[i];
    }
    cout << ans << endl;
	return 0;
}

Compiler output:
a.cc:10:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
   10 | #include <boost/multiprecision/cpp_int.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>

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


Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin >> n;
      |   ^~~
      |   std::cin
In file included 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:13:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 |   cout << result << 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:13:21: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   13 |   cout << result << endl;
      |                     ^~~~
      |                     std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

int main() {
  int n;
  cin >> n;
  ll ara[n + 5];
  for(int i = 0; i < n; i++)
    cin >> ara[i];
  
  ll ans = 0, now = 0;
  for(int i = 1; i <= 100000; i++) {
    now = 0;
    for(int j = 0; j < n; j++)
      now += i%ara[j];
    ans = max(ans, now);
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'll' was not declared in this scope
    7 |   ll ara[n + 5];
      |   ^~
a.cc:9:12: error: 'ara' was not declared in this scope
    9 |     cin >> ara[i];
      |            ^~~
a.cc:11:5: error: expected ';' before 'ans'
   11 |   ll ans = 0, now = 0;
      |     ^~~~
      |     ;
a.cc:13:5: error: 'now' was not declared in this scope; did you mean 'pow'?
   13 |     now = 0;
      |     ^~~
      |     pow
a.cc:15:16: error: 'ara' was not declared in this scope
   15 |       now += i%ara[j];
      |                ^~~
a.cc:16:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   16 |     ans = max(ans, now);
      |     ^~~
      |     abs
a.cc:18:11: 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;

int main() {
  int n;
  cin >> n;
  ll ara[n + 5];
  for(int i = 0; i < n; i++)
    cin >> ara;
  
  ll ans = 0, now = 0;
  for(int i = 1; i <= 100000; i++) {
    now = 0;
    for(int j = 0; j < n; j++)
      now += i%ara[j];
    ans = max(ans, now);
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'll' was not declared in this scope
    7 |   ll ara[n + 5];
      |   ^~
a.cc:9:12: error: 'ara' was not declared in this scope
    9 |     cin >> ara;
      |            ^~~
a.cc:11:5: error: expected ';' before 'ans'
   11 |   ll ans = 0, now = 0;
      |     ^~~~
      |     ;
a.cc:13:5: error: 'now' was not declared in this scope; did you mean 'pow'?
   13 |     now = 0;
      |     ^~~
      |     pow
a.cc:15:16: error: 'ara' was not declared in this scope
   15 |       now += i%ara[j];
      |                ^~~
a.cc:16:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   16 |     ans = max(ans, now);
      |     ^~~
      |     abs
a.cc:18:11: 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;

long long lcm(long long m, long long n ){
    long long r, x, tmp;
    x = a * b;

    if(a<b){
    tmp = a;
    a = b;
    b = tmp;
    }

    r = a % b;
    while(r!=0){
    a = b;
    b = r;
    r = a % b;
    }
 
    return x/b;  
}

int main(){
    int x;
    cin >> x;
    int y[3010];
    long long z = 1;
    for(int a = 0; a < x; a++){
        cin >> y[a];
        z = lcm(y[a], z);
    }
    int ans = 0;
    for(int b = 0; b < x; b++){
        ans += (z - 1) % y[b];
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'long long int lcm(long long int, long long int)':
a.cc:7:9: error: 'a' was not declared in this scope
    7 |     x = a * b;
      |         ^
a.cc:7:13: error: 'b' was not declared in this scope
    7 |     x = a * b;
      |             ^
Language: C++

#incldue<iostream>
using namespace std;
int main()
{
  	int n,a,s=0;
  	cin>>n;
  	for(int i=0;i<n;i++)
    {
      	cin>>a;
      	s+=a;
    }
  	cout<<s-n<<endl;
  	return 0;
}

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

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

int main(){
  int N;
  cin>>N;
  int a[N];
  ll int m,ans=0;
  int cou=1,mx=0;
  ll int r,tmp,b,c,x;

  for(int i=0;i<N;i++)cin>>a[i];
  for(int i=0;i<N;i++)ans+=a[i]-1
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:34: error: expected ';' before 'cout'
   14 |   for(int i=0;i<N;i++)ans+=a[i]-1
      |                                  ^
      |                                  ;
   15 |   cout<<ans<<endl;
      |   ~~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: 'i' was not declared in this scope
    8 |   for(i = 0;i<N;i++){
      |       ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n,s;
    cin>>n;
    int
    s=0;
    for(int i=0;i<n;i++)
    {
        int t;
        cin>>t;
        s+=t;
    }
    cout<<s-n<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: redeclaration of 'int s'
   10 |     s=0;
      |     ^
a.cc:7:11: note: 'int s' previously declared here
    7 |     int n,s;
      |           ^
Language: C++

#include<bits/stdc++.h>

using namespace std;

int main(){
    int x;
    cin >> x;
    int y[3010];
    int z = 1;
    for(int a = 0; a < x; a++){
        cin >> y[a];
        z *= y[a];
    }
    int ans = 0;
    for(int b = 0; b < x; b++){
        ans += (z - 1) % y[a];
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:28: error: 'a' was not declared in this scope
   16 |         ans += (z - 1) % y[a];
      |                            ^
Language: C++

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

const int Max_N = 1e5;

bool cmp(int x,int y){
	return x>y;	
}

void move_one(char *s,int n)
{
	char t = s[0];
	for(int i=1; i<n; ++i)
		s[i-1] = s[i];
	s[n-1] = t;
}

bool Equal(char *a,char *b)
{
	int length=strlen(a);
	for(int i=0; i<length; i++){
		if(a[i] != b[i])return false; 
	}	
	return true;
}
int main(){
	int N,a[Max_N + 5];
	cin>>N;
	int res = 0;
	for(int i=0; i<N; ++i){
		cin>>a[i];
		res += a[i];
	}

	cout<<res-N<<endl;
	return 0;
}
//m=11 5 + 3 + 2
/

Compiler output:
a.cc:39:1: error: expected unqualified-id before '/' token
   39 | /
      | ^
Language: C++

#include<iostream>
using namespace std;

int main()[
	int n;
  	cin >> n;
  	int a,sum=0-n;
  	for(int i=0; i<n; i++){ cin >> a; sum+=a;}
  	cout << sum << endl;
  	return 0;
  }

Compiler output:
a.cc:5:9: error: expected primary-expression before 'int'
    5 |         int n;
      |         ^~~
a.cc:4:12: error: expected ']' before 'int'
    4 | int main()[
      |            ^
      |            ]
    5 |         int n;
      |         ~~~ 
a.cc:6:9: error: 'cin' does not name a type
    6 |         cin >> n;
      |         ^~~
a.cc:7:21: error: 'n' was not declared in this scope
    7 |         int a,sum=0-n;
      |                     ^
a.cc:8:9: error: expected unqualified-id before 'for'
    8 |         for(int i=0; i<n; i++){ cin >> a; sum+=a;}
      |         ^~~
a.cc:8:22: error: 'i' does not name a type
    8 |         for(int i=0; i<n; i++){ cin >> a; sum+=a;}
      |                      ^
a.cc:8:27: error: 'i' does not name a type
    8 |         for(int i=0; i<n; i++){ cin >> a; sum+=a;}
      |                           ^
a.cc:9:9: error: 'cout' does not name a type
    9 |         cout << sum << endl;
      |         ^~~~
a.cc:10:9: error: expected unqualified-id before 'return'
   10 |         return 0;
      |         ^~~~~~
a.cc:11:3: error: expected declaration before '}' token
   11 |   }
      |   ^
Language: C++

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

Compiler output:
a.cc:23:2: error: stray '#' in program
   23 | }#include<bits/stdc++.h>
      |  ^
a.cc:23:3: error: 'include' does not name a type
   23 | }#include<bits/stdc++.h>
      |   ^~~~~~~
a.cc:25:11: error: redefinition of 'long long int gcd(long long int, long long int)'
   25 | long long gcd(long long x,long long y)
      |           ^~~
a.cc:3:11: note: 'long long int gcd(long long int, long long int)' previously defined here
    3 | long long gcd(long long x,long long y)
      |           ^~~
a.cc:30:5: error: redefinition of 'int main()'
   30 | int main()
      |     ^~~~
a.cc:8:5: note: 'int main()' previously defined here
    8 | int main()
      |     ^~~~
Language: C++

#include <iostream>
#include <stdlib.h>
#include <math.h>
#include <string>
#include <algorithm>
#include <numeric>
using namespace std;

int n;
int a[3100];

int lcm(int a, int b)
{
    int temp = __algo_gcd(a, b);

    return temp ? (a / temp * b) : 0;
}

int main() {
    cin >> n;
    for (int i = 0; i < n; ++i) cin >> a[i];

    int g = 1;
    for (int i = 0; i < n; ++i) {
        g = lcm(g, a[i]);
    }
    int m = g - 1;

    int s = 0;
    for (int j = 0; j < n; ++j) {
        s += m % a[j];
    }
    cout << s << endl;
}


Compiler output:
a.cc: In function 'int lcm(int, int)':
a.cc:14:16: error: '__algo_gcd' was not declared in this scope
   14 |     int temp = __algo_gcd(a, b);
      |                ^~~~~~~~~~
Language: C++

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

using namespace std;

typedef long long ll;

int gcd(int a, int b){
  while(b>0){
    int c=a;
    a=b;
    b=c%b;
  }
  return a; 
}

ll f(ll m, vector<int> a){
  ll res=0;
  for(int i=0;i<a.size();i++)res+=(m%a[i]);
  return res;
}

int main(void){


  int n,mx=0;
  vector<int>a(3000);

  cin >> n;
  for(int i=0;i<n;i++){
    cin >> a[i];
    mx = max(a[i], mx);
  }

  ll ans=0;
  for(int m=0;m<10*mx;m++){
    ans=max(ans,f(m));
  }

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


Compiler output:
a.cc: In function 'int main()':
a.cc:38:18: error: too few arguments to function 'll f(ll, std::vector<int>)'
   38 |     ans=max(ans,f(m));
      |                 ~^~~
a.cc:18:4: note: declared here
   18 | ll f(ll m, vector<int> a){
      |    ^
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<queue>
#include<numeric>

using namespace std;

int gcd(long long, long long);

int main(){
    int N;
    cin>>N;
    vector <long long>a(N);
    for(int i=0 ; i<N ; i++){
        cin>>a[i];
    }
    
    long long max = 0;
    long long lc = a[0]*a[1]/gcd(a[0], a[1]);
    for(int i=2 ; i<N ; i++){
        lc = lc*a[i]/gcd(lc, a[i]);
    }
    for(int i=0 ; i<N ; i++){
        max += (lc-1)%a[i];
    }

    cout<<max<<endl;
    
    return 0;
}
int gcd(long long a , long long b)
{
    max = max(a,b);
    min = min(a,b)
    long long r = max%min;
    if (r == 0) return min;
    while (r != 0){
        max = min;
        min = r;
        r = max % min;
    }
	return min;
}

Compiler output:
a.cc: In function 'int gcd(long long int, long long int)':
a.cc:35:18: error: overloaded function with no contextual type information
   35 |     max = max(a,b);
      |                  ^
a.cc:36:18: error: overloaded function with no contextual type information
   36 |     min = min(a,b)
      |                  ^
a.cc:38:9: error: 'r' was not declared in this scope
   38 |     if (r == 0) return min;
      |         ^
a.cc:38:24: error: cannot resolve overloaded function 'min' based on conversion to type 'int'
   38 |     if (r == 0) return min;
      |                        ^~~
a.cc:39:12: error: 'r' was not declared in this scope
   39 |     while (r != 0){
      |            ^
a.cc:40:15: error: overloaded function with no contextual type information
   40 |         max = min;
      |               ^~~
a.cc:42:17: error: invalid operands of types '<unresolved overloaded function type>' and '<unresolved overloaded function type>' to binary 'operator%'
   42 |         r = max % min;
      |             ~~~~^~~~~
a.cc:44:16: error: cannot resolve overloaded function 'min' based on conversion to type 'int'
   44 |         return min;
      |                ^~~
Language: C++

#include<vector>
#include<algorithm>

using namespace std;

int gcd(int a, int b){
  while(b>0){
    int c=a;
    a=b;
    b=c%b;
  }
  return a; 
}

int main(void){


  int n,mx=0;
  vector<int>a(3000);

  cin >> n;
  for(int i=0;i<n;i++){
    cin >> a[i];
    mx = max(a[i], mx);
  }

  long long ans=0;
  for(int m=0;m<5000000;m++){
    long long res=0;
    for(int i=0;i<n;i++){
      res+=m%a[i];
    }
    ans=max(ans,res);
  }

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


Compiler output:
a.cc: In function 'int main()':
a.cc:21:3: error: 'cin' was not declared in this scope
   21 |   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 | 
a.cc:36:3: error: 'cout' was not declared in this scope
   36 |   cout << ans << endl;
      |   ^~~~
a.cc:36:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:36:18: error: 'endl' was not declared in this scope
   36 |   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 |
Language: C++

#include<stdio.h>

int main(void){
	int n;
	scanf("%d",&n);
	int a[n];
	int sum = 0;
	for(int i=0;i<n;i++){
		scanf("%d",a+i);
		sum += a[i];
	
	}
	printf("%d",a[i]-n);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:23: error: 'i' was not declared in this scope
   13 |         printf("%d",a[i]-n);
      |                       ^
Language: C++

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

using namespace std;

int gcd(int a, int b){
  while(b>0){
    int c=a;
    a=b;
    b=c%b;
  }
  return a; 
}

int main(void){


  int n,mx=0;
  vector<int>a(3000);

  cin >> n;
  for(int i=0;i<n;i++){
    cin >> a[i];
    mx = max(a[i], mx);
  }

  long long ans=0;
  for(int m=0;m<5000000;m++){
    long long res=0;
    for(int i=0;i<n;+){
      res+=m%a[i];
    }
    ans=max(ans,res);
  }

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


Compiler output:
a.cc: In function 'int main()':
a.cc:31:22: error: expected primary-expression before ')' token
   31 |     for(int i=0;i<n;+){
      |                      ^
Language: C++



/*
                        --------------- Shuvo 's code-_______
                        /''''''''''(______O] ----------____  \______/]_
     __...---'"""\_ --''        Metropolitan university     ___________@ -> ->  -> - --  - -- - ---- ->>
 |'''                   ._   _______________=---------"""""""
 |                ..--''|   l L |_l   |
 |          ..--''      .  /-___j '   '
 |    ..--''           /  ,       '   '
 |--''                /           `    \
                      L__'         \    -
                                    -    '-.
                                     '.    /
                                       '-./
*/

///   ------------ Bismillah hirrahman nirrahim ----------   ///

#include <bits/stdc++.h>
#define ll long long int
#define ull unsigned long long
#define sc(n) scanf("%I64d", &n);
#define pr(n) printf("%I64d\n", n);
#define prr(n, m) printf("%I64d %I64d\n", n, m);
#define prrr(n, m, p) printf("%I64d %I64d %I64d\n", n, m, p);
#define lp(i,s,n) for(long long  i = s; i<n; i++)
#define pl(n) for(long long i=n-1; i>=0; i--)
#define  ars(arr,s,e) sort(arr+s,arr+n);
#define pb push_back
#define FastRead        ios_base::sync_with_stdio(0);cin.tie(0)

long long int mx = 1e18;
long long int mn = -1e18;
using namespace std;
ll a[3010];

s


int main()
{
//    FastRead;
    ll p,q,r,s,t,i, j,ii, x, jj, n, ans, sum = 0, cnt = 0, st,tc = 0, len ;
    string str;

    cin >> n;

    for(i=0; i<n; i++)
    {
        cin >> a[i];
        if(i == 0) ans =  a[0];
        else
        {
            ans = (ans*a[i]) / __gcd(ans, a[i]);
        }
    }

    ans--;

    for(i=0; i<n; i++)
    {
        sum += ans % a[i];
    }

    cout << sum << endl;
}



Compiler output:
a.cc:38:1: error: 's' does not name a type; did you mean 'sc'?
   38 | s
      | ^
      | sc
Language: C++

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

int main() {
  cin.tie(0);
  cin.sync_with_stdio(0);

  int n;
  cin >> n;
  ll ans = 0;
  while(n--) {
  	int x;
  	cin >> x;
  	ans += x-1;
  }
  cout << x << flush;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:11: error: 'x' was not declared in this scope
   17 |   cout << x << flush;
      |           ^
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<string>

using namespace std;

int main() {
	int N;	cin >> N;
	vector<int> a;
	int inputA;
	int num;
	vector<int> answer;
	for (int i = 0; i < N; ++i) {
		cin >> inputA;
		a.push_back(inputA);
	}
	for (int i = 1; i <= pow(*max_element(a.begin(), a.end()),3); ++i) {
		num = 0;
		for (int j = 0; j < N; ++j) {
			num += i % a[j];
		}
		answer.push_back(num);
	}
	cout << *max_element(answer.begin(), answer.end());
	cin >> N;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:30: error: 'pow' was not declared in this scope
   18 |         for (int i = 1; i <= pow(*max_element(a.begin(), a.end()),3); ++i) {
      |                              ^~~
Language: C++

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

using namespace std;

int main(void){


  int n,mx=0;
  vector<int>a(100000);

  cin >> n;
  for(int i=0;i<n;i++){
    cin >> a[i];
    mx = max(a[i], mx);
  }

  int ans=0;
  for(int i=0;i<mx;i++){
    int res=0;
    for(int j=0;j<n;j++){
      res+=i%a[j];
    }
    ans=max(ans,res);
  }

  cout << res << endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:11: error: 'res' was not declared in this scope
   28 |   cout << res << endl;
      |           ^~~
Language: C++

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

using namespace std;

int main(void){


  int n,mx=0;
  vector<int>a(100000);

  cin >> n;
  for(int i=0;i<n;i++){
    cin >> a[i];
    mx = max(a[i], mx);
  }

  ans=0;
  for(int i=0;i<mx;i++){
    res=0;
    for(int j=0;j<n;j++){
      res+=i%a[j];
    }
    ans=max(ans,res);
  }

  cout << res << endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
   19 |   ans=0;
      |   ^~~
      |   abs
a.cc:21:5: error: 'res' was not declared in this scope
   21 |     res=0;
      |     ^~~
a.cc:28:11: error: 'res' was not declared in this scope
   28 |   cout << res << endl;
      |           ^~~
Language: C++

#include(iostream)
using namespace std;
int main(){
    int a,b,c;
    cin>>a>>b>>c;
    cout<<"a+b+c-3"<<endl;
    return 0;
}


Compiler output:
a.cc:1:9: error: #include expects "FILENAME" or <FILENAME>
    1 | #include(iostream)
      |         ^
a.cc: In function 'int main()':
a.cc:5:5: error: 'cin' was not declared in this scope
    5 |     cin>>a>>b>>c;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #include(iostream)
a.cc:6:5: error: 'cout' was not declared in this scope
    6 |     cout<<"a+b+c-3"<<endl;
      |     ^~~~
a.cc:6:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:6:22: error: 'endl' was not declared in this scope
    6 |     cout<<"a+b+c-3"<<endl;
      |                      ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #include(iostream)
Language: C++

//:)
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>lex>
#include <cstring>
#include <cmath>
#include <queue>
#include <sstream>
#include <stack>
#include <time.h>
#include <vector>
#include <map>
#include <set>
#include <iomanip>
#include <math.h>
#include <stdlib.h>
#include <list>
#include <utility>
#include <memory>
#include <cstring>
#include <fstream>
#include <numeric>
#include <assert.h>
#include <bits/stdc++.h>
using namespace std;
int a[3003];
int main() {
	int n,ans=0;
	cin>>n;
	for (int i=0; i<n; i++){cin>>a[i];ans+=a[i]-1;}
	cout<<ans;
	return 0;
}

Compiler output:
a.cc:7:22: warning: extra tokens at end of #include directive
    7 | #include <cstdlib>lex>
      |                      ^
a.cc:7:10: fatal error: cstdlib>le: No such file or directory
    7 | #include <cstdlib>lex>
      |          ^~~~~~~~~~~~
compilation terminated.
Language: C++

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

#define INF 1e9
#define llINF 1e18
#define MOD 1e9+7
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
using namespace std;
ll gcd(ll a,ll b){
    ll r=a%b; 
    while(r!=0){ 
      a=b; 
      b=r; 
      r=a%b; 
    }
    return b;
}
ll koubai(ll a,ll b){
  return (a*b)/gcd(a,b); 
}
int main(){
  ll n;cin>>n;
  vector<ll>num(n);
  cin>>num[0];
  ll mae=num[0];
  for(int i=1;i<n;i++){
    cin>>num[i];
    mae=koubai(mae,num[i]);
  }
  ll ans=0;
  for(int i=0;i<n;i++){
    ans+=(mae-1)%num[i];
  }
  cout<<ans<<endl;
  return 0;
}


Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | V#include<bits/stdc++.h>
      |  ^
a.cc:1:1: error: 'V' does not name a type
    1 | V#include<bits/stdc++.h>
      | ^
a.cc: In function 'int main()':
a.cc:25:8: error: 'cin' was not declared in this scope
   25 |   ll n;cin>>n;
      |        ^~~
a.cc:26:3: error: 'vector' was not declared in this scope
   26 |   vector<ll>num(n);
      |   ^~~~~~
a.cc:10:12: error: expected primary-expression before 'long'
   10 | #define ll long long
      |            ^~~~
a.cc:26:10: note: in expansion of macro 'll'
   26 |   vector<ll>num(n);
      |          ^~
a.cc:27:8: error: 'num' was not declared in this scope; did you mean 'enum'?
   27 |   cin>>num[0];
      |        ^~~
      |        enum
a.cc:37:3: error: 'cout' was not declared in this scope
   37 |   cout<<ans<<endl;
      |   ^~~~
a.cc:37:14: error: 'endl' was not declared in this scope
   37 |   cout<<ans<<endl;
      |              ^~~~
Language: C++

//:)
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>lex>
#include <cstring>
#include <cmath>
#include <queue>
#include <sstream>
#include <stack>
#include <time.h>
#include <vector>
#include <comp
#include <map>
#include <set>
#include <iomanip>
#include <math.h>
#include <stdlib.h>
#include <list>
#include <utility>
#include <memory>
#include <cstring>
#include <fstream>
#include <numeric>
#include <assert.h>
#include <bits/stdc++.h>
using namespace std;
int a[3003];
int main() {
	int n,ans=0;
	cin>>n;
	for (int i=0; i<n; i++){cin>>a[i];ans+=a[i]-1;}
	cout<<ans;
	return 0;
}

Compiler output:
a.cc:7:22: warning: extra tokens at end of #include directive
    7 | #include <cstdlib>lex>
      |                      ^
a.cc:7:10: fatal error: cstdlib>le: No such file or directory
    7 | #include <cstdlib>lex>
      |          ^~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
#define intt long long
using namespace std;
int i , j;
int main ()
{
    intt n,ans = 0;
    cin >> n;
    for ( i = 1 ; i <= n ; i++ )
    {
        int x;
        cin >> x;
        ans += x;
    }
    cout << ans-x << endl;
    return 0;
}


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

#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a,b) for(int i=a;i<=b;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define vi vector<int>
#define pb push_back
#define pi pair<int,int>
#define vp vector<pair<int,int> >
#define mp make_pair
#define all(v) (v).begin(),(v).end()
using namespace std;
int gcd(int x,int y){
    return y?gcd(y,x%y):x;
}

signed main(){
    int n;
    cin>>n;
    vi a(n);
    rep(i,n)cin>>a[i];
    int ans=0;
    int m=1;
    rep(i,n){
        m=a[i]/gcd(m,a[i])*m;
    }
    m--;
    rep(i,n)ans+=m%a[i];
    cout<<ans<<endl;
    return 0;
}

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

#include <iostream>

int n;
int main() {
  cin >> n;
  long s = 0;
  for (int i = 0; i < n; ++i) {
    int a;
    cin >> a;
    s += a - 1;
  }
  cout << s << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin >> n;
      |   ^~~
      |   std::cin
In file included 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:12:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   12 |   cout << s << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:12:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   12 |   cout << s << endl;
      |                ^~~~
      |                std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>
#include <stdio.h>
#include <algorithm>
using namespace std;

struct my{
  int a;
  int b;
}s[100002];
bool mysort( my i,my j){
        if(i.a!=j.a)
            return i.a<j.a;
        else
            return i.b>j.b;
}

int main()
{
    int n,m;
    scanf("%d %d",&n,&m);
    for(int i=0;i<m;i++){
        scanf("%d %d",&s[i].a,&s[i].b);
    }
    sort(s,s+m,mysort);
    int sums=1;
    for(int i=1;i<m;i++){
            mins=(s[i-1].b<mins)?s[i-1].b:mins;
            if(s[i].a>=s[i-1].b)
                sums++;
    }
    printf("%d\n",sums);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:13: error: 'mins' was not declared in this scope
   27 |             mins=(s[i-1].b<mins)?s[i-1].b:mins;
      |             ^~~~
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for (int i=0; i<n; i++)
#define REP(i,x,n) for (int i=x; i<n; i++)
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using ll = long long;
using P = pair<int, int>;

int main(){
    int n, m;
    cin >> n >> m;
    vector<P> vec(m);
    rep(i,m){
        int a, b;
        cin >> a >> b;
        vec.first = b;
        vec.second = a;
    }
    sort(vec.begin(), vec.end());

    int cur = -1e9;
    int ans = 0;
    rep(i,n){
        if (vec[i].second >= cur){
            cur = vec[i].first;
            ans++;
        }
    }

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


Compiler output:
a.cc: In function 'int main()':
a.cc:17:13: error: 'class std::vector<std::pair<int, int> >' has no member named 'first'
   17 |         vec.first = b;
      |             ^~~~~
a.cc:18:13: error: 'class std::vector<std::pair<int, int> >' has no member named 'second'
   18 |         vec.second = a;
      |             ^~~~~~