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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:41:6: error: redeclaration of 'long long int ans'
   41 |   ll ans=0;
      |      ^~~
a.cc:38:6: note: 'long long int ans' previously declared here
   38 |   ll ans=0;
      |      ^~~
a.cc:42:9: error: expected ';' before 'for'
   42 |   ans-=n
      |         ^
      |         ;
a.cc:43:7: error: 'i' was not declared in this scope
   43 |   rep(i,n){
      |       ^
a.cc:7:34: note: in definition of macro 'rep'
    7 | #define rep(i, n) for (ll i = 0; i < (n); i++)
      |                                  ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:45:6: error: redeclaration of 'long long int ans'
   45 |   ll ans=0;
      |      ^~~
a.cc:42:6: note: 'long long int ans' previously declared here
   42 |   ll ans=0;
      |      ^~~
a.cc:46:9: error: expected ';' before 'for'
   46 |   ans-=n
      |         ^
      |         ;
a.cc:47:7: error: 'i' was not declared in this scope
   47 |   rep(i,n){
      |       ^
a.cc:7:34: note: in definition of macro 'rep'
    7 | #define rep(i, n) for (ll i = 0; i < (n); i++)
      |                                  ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:46:6: error: redeclaration of 'long long int ans'
   46 |   ll ans=0;
      |      ^~~
a.cc:42:6: note: 'long long int ans' previously declared here
   42 |   ll ans=0;
      |      ^~~
a.cc:47:9: error: expected ';' before 'for'
   47 |   ans-=n
      |         ^
      |         ;
a.cc:48:7: error: 'i' was not declared in this scope
   48 |   rep(i,n){
      |       ^
a.cc:7:33: note: in definition of macro 'rep'
    7 | #define rep(i, n) for(ll i = 0; i < (n); i++)
      |                                 ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:46:6: error: redeclaration of 'long long int ans'
   46 |   ll ans=0;
      |      ^~~
a.cc:42:6: note: 'long long int ans' previously declared here
   42 |   ll ans=0;
      |      ^~~
a.cc:47:9: error: expected ';' before 'for'
   47 |   ans-=n
      |         ^
      |         ;
a.cc:48:7: error: 'i' was not declared in this scope
   48 |   rep(i,n){
      |       ^
a.cc:7:34: note: in definition of macro 'rep'
    7 | #define rep(i, n) for (ll i = 0; i < (n); i++)
      |                                  ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:46:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   46 |     ans+=a[i];
      |     ^~~
      |     abs
a.cc:48:8: error: 'ans' was not declared in this scope; did you mean 'abs'?
   48 |   COUT(ans);
      |        ^~~
a.cc:17:24: note: in definition of macro 'COUT'
   17 | #define COUT(x) cout<<(x)<<endl
      |                        ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:45:9: error: expected ';' before 'for'
   45 |   ans-=n
      |         ^
      |         ;
a.cc:46:7: error: 'i' was not declared in this scope
   46 |   rep(i,n){
      |       ^
a.cc:7:34: note: in definition of macro 'rep'
    7 | #define rep(i, n) for (ll i = 0; i < (n); i++)
      |                                  ^
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
using namespace std;
typedef long long ll;
int main() {
  int n; cin >> n;
  vector<int> a(n);
  rep(i, n) cin >> a[i];
  int sum=0;
  rep(i, n) 
    sum += a[i];
  ans = sum - n;
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
   14 |   ans = sum - n;
      |   ^~~
      |   abs
Language: C++

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

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;

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


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

#include<iostream>
using namespace std;
int main(){
int n;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++)
    cin >> arr[i];
  // result 
  cout << accumulate(arr,arr+n,-n)<<'\n';

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: 'accumulate' was not declared in this scope
   10 |   cout << accumulate(arr,arr+n,-n)<<'\n';
      |           ^~~~~~~~~~
Language: C++

#include <iostream>

using namespace std;

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

    int a;
    int sum = 0;
    for (i = 0; i < N; i++) {
        cin >> a;
        sum += a-1;
    }

    cout << sum << endl;
}

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

import math

def lcm(a, b):
    return a * b // math.gcd(a, b)

n = int(input())
a = list(map(int, input().split(' ')))

m = 1

for i in a:
    m = lcm(m, i)

m -= 1
ans = 0

for e in a:
    ans += m % e

print(ans)


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import math
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: Java

import java.util.Scanner;

public class ABC103C{

    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        
        // input
        int num = scan.nextInt();
        int sum = 0;
        for(int i = 0; i < num; i++){
            sum += scan.nextInt() - 1;
        }

        // answer
        System.out.println(sum);

    }
}

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

#include <iostream>

#define RPT(i, n) for (int i = 0; i < n; i++)

using namespace std;

// ABC103-C - Modulo Summation
int main()
{
    int N;
    vector<int> a;

    cin >> N;
    RPT(i, N) {
        int tmp;
        cin >> tmp;
        a.push_back(tmp);
    }

    int ans = 0;
    RPT(i, N) ans += a[i];
    ans -= N;

    cout << ans << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'vector' was not declared in this scope
   11 |     vector<int> a;
      |     ^~~~~~
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 | 
a.cc:11:12: error: expected primary-expression before 'int'
   11 |     vector<int> a;
      |            ^~~
a.cc:17:9: error: 'a' was not declared in this scope
   17 |         a.push_back(tmp);
      |         ^
a.cc:21:22: error: 'a' was not declared in this scope
   21 |     RPT(i, N) ans += a[i];
      |                      ^
Language: C++

#include<iostream>
#include<string>
#include<cstring>
#include<algorithm>
#include<vector>
#include<cmath>
#include<map>
#include<set>
#include<cstdio>
#define MAXA 100000
#define MAX 20000000000
#define s(i) scanf("%d", &(i))
#define p(i) printf("%d", (i))
#define ps() printf(" ") 
#define rer(i,j,k) for((i)=(j);(i)<(k);++(i))
#define ret(i,j,k) for((i)=(j);(i)>(k);--(i))
using namespace std;


int main(){
	int i, sum = 0, m;
	cin >> n;
	rer(i,0,n){
		cin >> m;
		sum += (m-1);
	}
	cout << sum << endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:16: error: 'n' was not declared in this scope
   22 |         cin >> n;
      |                ^
Language: C

#include<stdio.h>
#include<string.h>
int main(void){
   int N,a[4000],big=0,x,tmp,r,w,b,i=0,mod;
   scanf("%d",&N);
   for(i=0;i<N;i++){
      scanf("%d",&a[i]);
      mod+=a[i]-1;
         }
  pritf("%d",mod);

   return 0;
}


Compiler output:
main.c: In function 'main':
main.c:10:3: error: implicit declaration of function 'pritf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   10 |   pritf("%d",mod);
      |   ^~~~~
      |   printf
Language: C++

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

int main(){
　int m,ans;
  cin>>m;
  vector<int> a(m);

for(int i=0;i<a.size();i++){
    ans=a.at(i)-1;
}

cout<<ans;
  
  
 
}

Compiler output:
a.cc:7:1: error: extended character 　 is not valid in an identifier
    7 | 　int m,ans;
      | ^
a.cc: In function 'int main()':
a.cc:7:1: error: '\U00003000int' was not declared in this scope
    7 | 　int m,ans;
      | ^~~~~
a.cc:8:8: error: 'm' was not declared in this scope; did you mean 'tm'?
    8 |   cin>>m;
      |        ^
      |        tm
a.cc:12:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   12 |     ans=a.at(i)-1;
      |     ^~~
      |     abs
a.cc:15:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
   15 | cout<<ans;
      |       ^~~
      |       abs
Language: C++

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

#define REP(i, n) for (int (i) = 0 ; (i) < (int)(n) ; ++(i))
#define REPN(i, m, n) for (int (i) = m ; (i) < (int)(n) ; ++(i))
#define REP_REV(i, n) for (int (i) = (int)(n) - 1 ; (i) >= 0 ; --(i))
#define REPN_REV(i, m, n) for (int (i) = (int)(n) - 1 ; (i) >= m ; --(i))

#define INF 2e9
#define INF_LL 1LL<<60
#define ll long long

typedef pair<ll, ll> P;

int gcd(ll a, ll b){
    if(a<b){
        int tmp = a;
        a = b;
        b = tmp;
    }

    ll r = a%b;
    while(r!=0){
        a = b;
        b = r;
        r = a % b;
    }

    return b;
}

int main(){
    int n;
    cin >> n;
    int a[n];
    int ans = 0;
    REP(i, n) cin >> a[i]; ans += a[i];

    cout << ans << endl;

    

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:37: error: 'i' was not declared in this scope
   37 |     REP(i, n) cin >> a[i]; ans += a[i];
      |                                     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
signed main(){
  int a,b[10000],c=0;
  pair<int,int> q;
  p.fi=0,p.se=0;
  cin>>a;
  for(int i=0;i<a;i++) cin>>b[i];
  for(int i=1;i<200000;i++){
    c=0;
    for(int i=0;i<a;i++){
      c+=i%b[i];
    }
    if(p.fi<c) p.fi=c,p.se=i;
  }
  cout<<p.se<<"\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'p' was not declared in this scope
    8 |   p.fi=0,p.se=0;
      |   ^
Language: C++

#include<bits/stdc++.h>
main(){
  int n:
  std::cin>>n;
  std::vector<int> a(n);
  for(auto& ai:a)std::cin>>ai;
  long ans=0;
  for(auto x:a)ans+=x-1;
  std::cout<<ans<<std::endl;
}

Compiler output:
a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:3:8: error: found ':' in nested-name-specifier, expected '::'
    3 |   int n:
      |        ^
      |        ::
a.cc:3:7: error: 'n' has not been declared
    3 |   int n:
      |       ^
a.cc:4:11: error: qualified-id in declaration before '>>' token
    4 |   std::cin>>n;
      |           ^~
a.cc:5:22: error: 'n' was not declared in this scope
    5 |   std::vector<int> a(n);
      |                      ^
Language: C

include<stdio.h>
int gcd(int a, int b)
{
    if(b==0)
        return a;
    return gcd(b,a%b);
}
int lcm( int a, int b)
{
    return a*b/(gcd(a,b));
}
int main()
{
    int n,i;
    scanf("%d",&n);
    long long int a[n],sum=0,l;
    for(i=0;i<n;i++)
        scanf("%lld",&a[i]);
    l=a[0];
    for(i=0;i<n;i++)
        l=lcm(l,a[i]);
    l=l-1;
    for(i=0;i<n;i++)
        sum+=l%a[i];
    printf("%lld",sum);
}


Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
main.c: In function 'lcm':
main.c:10:17: error: implicit declaration of function 'gcd' [-Wimplicit-function-declaration]
   10 |     return a*b/(gcd(a,b));
      |                 ^~~
main.c: In function 'main':
main.c:15:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   15 |     scanf("%d",&n);
      |     ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | include<stdio.h>
main.c:15:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   15 |     scanf("%d",&n);
      |     ^~~~~
main.c:15:5: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:25:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   25 |     printf("%lld",sum);
      |     ^~~~~~
main.c:25:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:25:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:25:5: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

// C++ program to find LCM of n elements 
#include <bits/stdc++.h> 
using namespace std; 
  
typedef long long int ll; 
  
// Utility function to find 
// GCD of 'a' and 'b' 
int gcd(int a, int b) 
{ 
    if (b == 0) 
        return a; 
    return gcd(b, a % b); 
} 
  
// Returns LCM of array elements 
ll findlcm(int arr[], int n) 
{ 
    // Initialize result 
    ll ans = arr[0]; 
  
    // ans contains LCM of arr[0], ..arr[i] 
    // after i'th iteration, 
    for (int i = 1; i < n; i++) 
        ans = (((arr[i] * ans)) / 
                (gcd(arr[i], ans))); 
  
    return ans; 
} 
  
// Driver Code 
int main() 
{ 
    int n;
 cin>>n;
    int a[n],sum=0,i,r;
    for(i=0;i<n;i++)
    cin>>a[i];
    r=findlcm(int a[n], int n);
    r=r-1;
    for(i=0;i<n;i++)
    sum+=r%a[i]; 
cout<<sum;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:39:15: error: expected primary-expression before 'int'
   39 |     r=findlcm(int a[n], int n);
      |               ^~~
a.cc:39:25: error: expected primary-expression before 'int'
   39 |     r=findlcm(int a[n], int n);
      |                         ^~~
Language: C

// C++ program to find LCM of n elements 
#include <bits/stdc++.h> 
using namespace std; 
  
typedef long long int ll; 
  
// Utility function to find 
// GCD of 'a' and 'b' 
int gcd(int a, int b) 
{ 
    if (b == 0) 
        return a; 
    return gcd(b, a % b); 
} 
  
// Returns LCM of array elements 
ll findlcm(int arr[], int n) 
{ 
    // Initialize result 
    ll ans = arr[0]; 
  
    // ans contains LCM of arr[0], ..arr[i] 
    // after i'th iteration, 
    for (int i = 1; i < n; i++) 
        ans = (((arr[i] * ans)) / 
                (gcd(arr[i], ans))); 
  
    return ans; 
} 
  
// Driver Code 
int main() 
{ 
    int size;
scanf("%d",&size);
int a[n],sum=0,i,r;
for(i=0;i<n;i++)
scanf("%d",&a[i]);
r=findlcm(int a[n], int n);
r=r-1;
for(i=0;i<n;i++)
sum+=r%a[i];
printf("%d",sum);
    return 0; 
} 

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

#include<stdio.h>
int main() {
  long long int n, a[3001], i, j, f, max, fmax=0;;
  scanf("%lld", &n);
  max=0;
  if(i=0; i<n; ++i) {
    scanf("%lld", a+i);
    if(a[i]>max) max=a[i];
  }
  for(i=max; i<(max*2); ++i)
  {
    for(j=0; j<n; ++j) {
      f+=i%a[j];
    }
    if(f>fmax) fmax=f;
  }
  printf("%lld", fmax);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:9: error: expected ')' before ';' token
    6 |   if(i=0; i<n; ++i) {
      |     ~   ^
      |         )
Language: C

#include<stdio.h>
int main() {
  long long int n, a[3001], i, j, f, max, fmax=0;;
  scanf("%lld", &n);
  min=max=0;
  if(i=0; i<n; ++i) {
    scanf("%lld", a+i);
    if(a[i]>max) max=a[i];
  }
  for(i=max; i<(max*2); ++i)
  {
    for(j=0; j<n; ++j) {
      f+=i%a[j];
    }
    if(f>fmax) fmax=f;
  }
  printf("%lld", fmax);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:3: error: 'min' undeclared (first use in this function); did you mean 'main'?
    5 |   min=max=0;
      |   ^~~
      |   main
main.c:5:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:9: error: expected ')' before ';' token
    6 |   if(i=0; i<n; ++i) {
      |     ~   ^
      |         )
Language: C++

#include <iostream>

using namespace std;

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

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

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

// 昇順 sort(v.begin(), v.end());
// 降順 sort(v.begin(), v.end(), greater<int>());
gcd(int a, int b){
  if(b == 0){
    return a;
  }
  return gcd(b, a%b);
}


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:7:1: error: ISO C++ forbids declaration of 'gcd' with no type [-fpermissive]
    7 | gcd(int a, int b){
      | ^~~
Language: C++

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

gcd(int a, int b){
  if(b == 0){
    return a;
  }
  return gcd(b, a%b);
}


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:5:1: error: ISO C++ forbids declaration of 'gcd' with no type [-fpermissive]
    5 | gcd(int a, int b){
      | ^~~
Language: C++

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

/*
昇順 sort(v.begin(), v.end());
降順 sort(v.begin(), v.end(), greater<int>());
*/
gcd(int a, int b){
  if(b == 0){
    return a;
  }
  return gcd(b, a%b);
}


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:9:1: error: ISO C++ forbids declaration of 'gcd' with no type [-fpermissive]
    9 | gcd(int a, int b){
      | ^~~
Language: C++

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

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

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

    int M = std::accumulate(std::begin(a), std::end(a), 0);

    int ans = 0;
    for (int i = 1; i <= M; i++) {
        int f = 0;
        for (int j = 0; j < N; j++) {
            f += (i % a[j]);
        }
        ans = std::max(ans, f);
    }

    std::cout << ans << std::endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:18: error: 'accumulate' is not a member of 'std'
   15 |     int M = std::accumulate(std::begin(a), std::end(a), 0);
      |                  ^~~~~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
#include <sstream>
#include <utility>
#include <iomanip>
#include <tuple>
#define ll long long int
#define rep(i,x,y) for(int i=x;i<y;i++)
#define rel(i,x,y) for(int i=x-1;i>=y;i--)
#define all(x) x.begin(),x.end()
using namespace std;


int main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	int n;
	cin >> n;
	vector<ll> a(n);
	rep(i,0,n) cin >> a[i];
	cout << accumulate(all(a),0)-a.size() << endl;

}


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

n = read_line.to_i
a = read_line.split.map(&.to_i)

ans = a.map{|v| v-1 }.sum

puts ans

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n = read_line.to_i
      | ^
a.cc:4:22: error: expected unqualified-id before '.' token
    4 | ans = a.map{|v| v-1 }.sum
      |                      ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
//char型から数値型に変換する関数（z.at(i)などに使用）
int ctoi(char c){
	if(c>='0'&&c<='9'){
		return c-'0';
	}
	return 0;
}
//入力した値の階乗（を1000000007で割ったあまり）を求める関数
int fact(int64_t x){
  int64_t y=1;
  if(x==0){
    return 1;
  }
  else{
  for(int64_t i=1;i<=x;i++){
   y*=i;
   y%=1000000007;
  }
  return y;
  }
}
// mod. m での a の逆元 a^{-1} を計算する関数
int64_t modinv(int64_t a,int64_t m) {
    int64_t b=m,u=1,v=0;
    while(b){
        int64_t t=a/b;
        a-=t*b;swap(a,b);
        u-=t*v;swap(u,v);
    }
    u%=m;
    if(u<0)u+=m;
    return u;
}
// a ÷ b mod.1000000007 
// a を 10000000007 で割ってから b の逆元をかけて計算
// a*modinv(b,1000000007)%1000000007
//nCr（を1000000007で割ったあまり）を求める関数
int combi(int64_t n,int64_t r){
  int64_t z=(fact(n-r)*fact(r))%1000000007;
  return fact(n)*modinv(z,1000000007)%1000000007;
}
int main() {
  int64_t n;
  cin>>n;
  vector<int64_t> a(n);
  for(int i=0;i<n;i++){
    cin>>sum.at(i);
  }
  int64_t sum=0;
  for(int i=0;i<n;i++){
    sum+=a.at(i);
  }
  cout<<sum;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:10: error: 'sum' was not declared in this scope
   49 |     cin>>sum.at(i);
      |          ^~~
Language: Java

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

        System.out.println(sum);
    }
}

Compiler output:
Main.java:12: error: ';' expected
        sc.close()
                  ^
1 error
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <cassert>
#include <algorithm>
#include <functional>
#include <cmath>
#include <utility>
#include <numeric>
#include <map>
#include <iomanip>
using namespace std;

int rec(int a, int b){
	if(b == 0) return a;
	return rec(b, a%b);
}

int LCM(int a, int b){
	int gcm = rec(a, b);
	return a * b / gcm;
}

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

	int lcm = a[0];
	for(int i = 1; i < N; i++){
		lcm = LCM(lcm, a[i]);
	}

	int ans = 0;
	for(int i = 0; i < N; i++){
		ans += (lcm - 1) % a[i];
	}

	cout << ans << endl;
}

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

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

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:8:9: error: 'cin' was not declared in this scope
    8 |         cin>>n;
      |         ^~~
a.cc:15:3: error: 'cout' was not declared in this scope
   15 |   cout<<s-n<<endl;
      |   ^~~~
a.cc:15:14: error: 'endl' was not declared in this scope
   15 |   cout<<s-n<<endl;
      |              ^~~~
Language: C++

#include<bits/stdc++.h>
#include<iostream>
using namespace std;
#define mn 100005
#define FLN "code"
#define endl "\n"
#define fi first
#define se second
#define inf 4444444444444444444
#define mod 1000000009
#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define FOR0(i, a) for (int i=0; i<(a); i++)
#define FOR1(i, a) for (int i=1; i<=(a); i++)
#define codenhanh(); ios_base::sync_with_stdio(0) ,cin.tie(0),cout.tie(0);
int n,m,b[mn],c[mn];
int dem=0;
int ttl=0;
signed main()
{
	codenhanh();
	for(int i=1;i<=8;i++)
	{
		cin>>a[i];
	}
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>b[i]>>c[i];
	}
	
	
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:22: error: 'a' was not declared in this scope
   23 |                 cin>>a[i];
      |                      ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
 int n;
  cin >> n;
 
  long res=0;
  

  for(int i=0;i<n;i++){
    cin >> t;
    res+=(t-1);
  }
    
  cout << res << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:12: error: 't' was not declared in this scope
   13 |     cin >> t;
      |            ^
Language: C++

// Author : MohamedSameh
#include <bits/stdc++.h>
typedef long long ll ;
#define pb push_back
#define f first
#define s second
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define SZ(a) (int)a.size()
#define IN(n) scanf("%d" , &n )
#define debug(x) cout<<#x<<" = { "<<x<<" }\n"
void fo (){fflush(stdout);}
using namespace std;
int n ;
int ans ;
int main ()
{
scanf ("%d" , &n );
for (int i=0,j;i<n;i++)
{
  scanf ("%d" , &t );
  ans += t-1;
}
printf ("%d\n" ,ans ); 
cerr << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
  return 0;
}


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

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,val;
    unsigned int count=0;
    cin >> n;
 while(n--) {
     cin >> val
     count +=(--val);
  } 
     cout << count;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: expected ';' before 'count'
    8 |      cin >> val
      |                ^
      |                ;
    9 |      count +=(--val);
      |      ~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
int a,s;cin>>a;
while(cin>>a)sum+=a;
cout<<sum-n;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:14: error: 'sum' was not declared in this scope
    5 | while(cin>>a)sum+=a;
      |              ^~~
a.cc:6:7: error: 'sum' was not declared in this scope
    6 | cout<<sum-n;
      |       ^~~
a.cc:6:11: error: 'n' was not declared in this scope
    6 | cout<<sum-n;
      |           ^
Language: C++

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

const int MOD = 1000000007;

// begin() end()
#define all(x) (x).begin(),(x).end()

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)

//最大公約数 
unsigned gcd(unsigned a, unsigned b) {
  if(a < b) return gcd(b, a);
  unsigned r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}

//最小公倍数
int lcm(int number1,int number2){
	return number1 * number2 / gcd(number1,number2);	
}
  
int main(){
int N;
cin >> N;

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

int sum = 0;
REP(i,N){
    sum += a[i] - 1;
}

cout << aum << endl; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:9: error: 'aum' was not declared in this scope; did you mean 'sum'?
   41 | cout << aum << endl;
      |         ^~~
      |         sum
Language: C++

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

int main()
{
    int n;
    cin >> n;
    vector<int> a(n);
    int sum = 0;
    for(int i = 0; i < n; i++) {
        cin >> a[i];
        sum += a[i] - 1;
    }
    cour << sum << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:5: error: 'cour' was not declared in this scope
   15 |     cour << sum << endl;
      |     ^~~~
Language: C++

#ifdef NOW_PROBLEM  
#define REP(i, n) for(int i = 0; i < (int)(n); i++)

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

int main() {
	int N;
	cin >> N;
	vector<int> a(N);

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

	int max_mod = 0;
	REP(i, N) {
		max_mod += a[i];
	}
	max_mod -= N;

	cout << max_mod << endl;

	return 0;
}


Compiler output:
a.cc:1: error: unterminated #ifdef
    1 | #ifdef NOW_PROBLEM
Language: C++

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

int main() {
    ll n; cin >> n;
    vector<ll> a(n); rep (i, n) cin >> a[i];

    ll ans = 0;
    ll ma = max_element(a.begin(), a.end());
    for (ll i = 1; i <= ma; i++) {
        ll sum = 0;
        for (ll j = 0; j < n; j++) {
            sum += i % a[j];
        }
        ans = max(ans, sum);
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:24: error: cannot convert '__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >' to 'll' {aka 'long long int'} in initialization
   11 |     ll ma = max_element(a.begin(), a.end());
      |             ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
      |                        |
      |                        __gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >
Language: C++

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

int main() {
    ll n; cin >> n;
    vector<ll> a(n); rep (i, n) cin >> a[i];

    ll ans = 0;
    ll max = max_element(a.begin(), a.end());
    for (ll i = 1; i <= max; i++) {
        ll sum = 0;
        for (ll j = 0; j < n; j++) {
            sum += i % a[j];
        }
        ans = max(ans, sum);
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:25: error: cannot convert '__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >' to 'll' {aka 'long long int'} in initialization
   11 |     ll max = max_element(a.begin(), a.end());
      |              ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
      |                         |
      |                         __gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >
a.cc:17:18: error: 'max' cannot be used as a function
   17 |         ans = max(ans, sum);
      |               ~~~^~~~~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <math.h>
#include <string.h>
#include <map>
#include <numeric>
#include <random>
#include <queue>
#include <deque>
#include <tuple>
#include <iomanip>
using namespace std;

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

  cout<<accumulate(a.begin,a.end,0ll)-n<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:19: error: no matching function for call to 'accumulate(<unresolved overloaded function type>, <unresolved overloaded function type>, long long int)'
   23 |   cout<<accumulate(a.begin,a.end,0ll)-n<<endl;
      |         ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/numeric:62,
                 from a.cc:8:
/usr/include/c++/14/bits/stl_numeric.h:134:5: note: candidate: 'template<class _InputIterator, class _Tp> _Tp std::accumulate(_InputIterator, _InputIterator, _Tp)'
  134 |     accumulate(_InputIterator __first, _InputIterator __last, _Tp __init)
      |     ^~~~~~~~~~
/usr/include/c++/14/bits/stl_numeric.h:134:5: note:   template argument deduction/substitution failed:
a.cc:23:19: note:   couldn't deduce template parameter '_InputIterator'
   23 |   cout<<accumulate(a.begin,a.end,0ll)-n<<endl;
      |         ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_numeric.h:161:5: note: candidate: 'template<class _InputIterator, class _Tp, class _BinaryOperation> _Tp std::accumulate(_InputIterator, _InputIterator, _Tp, _BinaryOperation)'
  161 |     accumulate(_InputIterator __first, _InputIterator __last, _Tp __init,
      |     ^~~~~~~~~~
/usr/include/c++/14/bits/stl_numeric.h:161:5: note:   candidate expects 4 arguments, 3 provided
Language: C++

#include<iostream>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<int> vec(N);
  for(int i = 0;i < N;i++) {
    cin >> vec.at(i);
  }
  int count = 1;
  for(int j = 0;j < N;j++) {
    count = count * vec.at(i);
  }
  count = count - 1;
  int answer = 0;
  for(int k = 0;k  N;k++) {
    answer = answer + count % vec.at(k)
  }
  cout << answer << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int> vec(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:10: error: expected primary-expression before 'int'
    7 |   vector<int> vec(N);
      |          ^~~
a.cc:9:12: error: 'vec' was not declared in this scope
    9 |     cin >> vec.at(i);
      |            ^~~
a.cc:13:21: error: 'vec' was not declared in this scope
   13 |     count = count * vec.at(i);
      |                     ^~~
a.cc:13:28: error: 'i' was not declared in this scope
   13 |     count = count * vec.at(i);
      |                            ^
a.cc:17:18: error: expected ';' before 'N'
   17 |   for(int k = 0;k  N;k++) {
      |                  ^ ~
      |                  ;
a.cc:17:21: error: expected ')' before ';' token
   17 |   for(int k = 0;k  N;k++) {
      |      ~              ^
      |                     )
a.cc:17:22: error: 'k' was not declared in this scope
   17 |   for(int k = 0;k  N;k++) {
      |                      ^
Language: C++

#include <iostream>

using namespace std;

int main(){
    int N,M;
    cin >> N >> M;
    pair<int,int> P[M];
    for(int i = 0; i < M; i++){
        cin >> P[i].second >> P[i].first;
    }

    sort(P,P+M);
    int ans = 0;
    int now = P[0].first;
    for(int i = 0; i < M; i++){
        if(now <= P[i].second){
            ans++;
            now = P[i].first;
        }
    }

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


Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   13 |     sort(P,P+M);
      |     ^~~~
      |     short
Language: C++

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

int main(){
  int aans;
cin>>a;
  ans=0;
  vector<int>b(a);
  for(int i=0;i<a;i++){
  cin>>b[i];
ans+=b[i];
    }
  
      cout<<ans<<endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:6: error: 'a' was not declared in this scope
    7 | cin>>a;
      |      ^
a.cc:8:3: error: 'ans' was not declared in this scope; did you mean 'aans'?
    8 |   ans=0;
      |   ^~~
      |   aans
Language: C

#include <stdio.h>

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

Compiler output:
main.c: In function 'main':
main.c:6:39: error: subscripted value is neither array nor pointer nor vector
    6 |   for(i = 0; i < n; i++)scanf("%d", &a[i]);
      |                                       ^
main.c:7:34: error: subscripted value is neither array nor pointer nor vector
    7 |   for(i = 0; i < n; i++) cnt += a[i];
      |                                  ^
Language: C++

#include <iostream>
int main(){
  int n,a=0,t;
  cin>>n;
  while(n--){
    cin>>t;
    a+=t-1;
  }
  cout<<a;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    4 |   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:9:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 |   cout<<a;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

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

Compiler output:
a.cc:15:3: error: 'cout' does not name a type
   15 |   cout << ans-N << endl;
      |   ^~~~
a.cc:16:3: error: expected unqualified-id before 'return'
   16 |   return 0;
      |   ^~~~~~
a.cc:17:1: error: expected declaration before '}' token
   17 | }
      | ^
Language: C++

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

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

Compiler output:
a.cc:2:2: error: invalid preprocessing directive #using
    2 | #using namespace std;
      |  ^~~~~
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 /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<long long int> vec(N);
      |   ^~~~~~
a.cc:7:3: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53:
/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:7:10: error: expected primary-expression before 'long'
    7 |   vector<long long int> vec(N);
      |          ^~~~
a.cc:9:10: error: 'vec' was not declared in this scope
    9 |     cin>>vec.at(i);
      |          ^~~
a.cc:13:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 |   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:13:14: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   13 |   cout<<ans<<endl;
      |              ^~~~
      |              std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <bits/stdc++.h>

#define int long long
#define MOD 1000000007

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define all(i) (i).begin(), (i).end()
#define rall(i) (i).begin(), (i).end(), greater<int>()
using namespace std;

#define elif else if
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define fst first
#define sec second
template <typename T>
void print(T x)
{
    std::cout << x << '\n';
}

//typedef long long ll;
#define TENNINE 1000000005
#define TENFIVE 100005
//#define int long long

int N;
vector<int> a;

signed main()
{
    cin >> N;
    a.resize(N);

    rep(i,N){
        cin>>a[i];
    }

    int m=0;
    reo(i,N){
        m+=a[i]-1;
    }
    
    cout <<m<<endl;


    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:45:9: error: 'i' was not declared in this scope
   45 |     reo(i,N){
      |         ^
a.cc:45:5: error: 'reo' was not declared in this scope; did you mean 'rep'?
   45 |     reo(i,N){
      |     ^~~
      |     rep
Language: C++

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

int main(){
  int n;
  vector<int>a(N);
  
  cin>>n;
  
  for(int i=0;i<n;i++)
    cin>>a.at(i);
  
  int res=0;
  
  for (int i=0;i<n;i++)
    res+=a.at(i);
  
  res-=n;
  
  cout<<res;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:16: error: 'N' was not declared in this scope
    6 |   vector<int>a(N);
      |                ^
Language: C++

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

int main(){
  int n;
  vector<int>a(N);
  
  cin>>n;
  
  for(int i=0;i<n;i++)
    cin>>a.at(i);
  
  int res=0;
  
  for (int i=0;i<n;i++)
    res+=a.at(i);
  
  res-=N;
  
  cout<<res;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:16: error: 'N' was not declared in this scope
    6 |   vector<int>a(N);
      |                ^