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

#pragma once
#include <vector>
#include <algorithm>
#include <assert.h>
typedef long long ll;
struct Factorial
{
	Factorial(int n_) :n(n_) { init(); }
	const ll mod = 1000000007;//modは素数だと仮定

	int n;
	std::vector<ll> fac_, inv_;


	void init() {
		fac_.resize(n+1);
		inv_.resize(n+1);
		calc_factorial();
		calc_inv();
	}

	//累乗の計算
	void calc_factorial() {
		fac_[0] = 1;
		for (int i = 1; i <= n; i++) {
			fac_[i] = i * fac_[i - 1] % mod;
		}
	}
	
	ll mod_pow(ll x, ll n, ll mod) {
		if (n == 0) { return 1; }
		ll res = mod_pow(x * x % mod, n / 2, mod);
		if (n & 1) { res = res * x % mod; }
		return res;
	}
	//逆元の計算
	void calc_inv() {
		inv_[n] = mod_pow(fac_[n], mod - 2, mod);
		for (int i = n - 1; i >= 0; i--) {
			inv_[i] = (i + 1) * inv_[i + 1] % mod;
		}
	}

	//逆元を返す
	ll inv(size_t i) {
		assert(i >= 0 && i <= n);
		return inv_[i];
	}
	//1  以上 N 以下の N 個の整数の中から，相異なる K 個の整数を選ぶパターンの数
	ll comb(int n, int k) {
		if (n < k)return 0;
		ll res = fac_[n];
		res = res * inv_[n - k] % mod;
		res = res * inv_[k] % mod;
		return res;
	}

	//1  以上 N 以下の N 個の整数の中から，相異なる K 個の整数を選び，順番に並べるパターンの数を P(N,K)
	ll perm(int n, int k) {
		if (n < k)return 0;
		ll res = fac_[n];
		res = res * inv_[n - k] % mod;
		return res;
	}
	//1 以上 N 以下の N 個の整数の中から，重複を許して K 個の整数を選ぶパターンの数
	ll h(int n, int k) {
		if (n == 0 && k == 0)return 1;
		return comb(n + k - 1, k);
	}
	//階乗(n!)を返す
	ll fac(size_t i) {
		assert(i >= 0 && i <= n);
		return fac_[i];
	}
};

Compiler output:
a.cc:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p;
const int INF = (1 << 28);
int n;
int vector<int> v;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> x;
    for(int i=0;i<n;i++) {
        int a;
        cin>>a;
        v.push_back(a);
    }
    int ans=0;
    for(int i=0;i<n;i++){
        ans+=v[i];
        ans--;
    }

    cout << ans<< "\n";
}

Compiler output:
a.cc:24:17: error: invalid declarator before 'v'
   24 | int vector<int> v;
      |                 ^
a.cc: In function 'int main()':
a.cc:29:12: error: 'x' was not declared in this scope
   29 |     cin >> x;
      |            ^
a.cc:33:9: error: 'v' was not declared in this scope
   33 |         v.push_back(a);
      |         ^
a.cc:37:14: error: 'v' was not declared in this scope
   37 |         ans+=v[i];
      |              ^
Language: C++

import math

N=int(input())
A=[int(i) for i in input().split()]

def Lcm(A):
    ans=A[0]
    for i in A[1:]:
        ans = ans * i // math.gcd(ans,i)
    return ans

m = Lcm(A)-1
ans = 0

for i in A:
    ans += m%i
    
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: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
REP(i,v.size()){if(i)os<<" ";os<<v[i];}return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
REP(i,v.size()){if(i)os<<endl;os<<v[i];}return os;}




ll yoshi(ll n,ll y){ return n % y;}



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


  ll M = 1;
  
  rep(i, N) M *= A[i];
  
   --M;


   ll ans = 0;


   rep(i, N) ans += yoshiyoshi(M, A[i]);


   cout << ans << endl;



  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:21: error: 'yoshiyoshi' was not declared in this scope
   45 |    rep(i, N) ans += yoshiyoshi(M, A[i]);
      |                     ^~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
REP(i,v.size()){if(i)os<<" ";os<<v[i];}return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
REP(i,v.size()){if(i)os<<endl;os<<v[i];}return os;}

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


  ll M = 1;
  
  rep(i, N) M *= A[i];
  
   --M;



   ll f(ll n,ll A) return n % A;


   ll ans = 0;


   rep(i, N) ans += f(M, A[i]);


   cout << ans << endl;



  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:20: error: a function-definition is not allowed here before 'return'
   36 |    ll f(ll n,ll A) return n % A;
      |                    ^~~~~~
a.cc:42:21: error: 'f' was not declared in this scope
   42 |    rep(i, N) ans += f(M, A[i]);
      |                     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
REP(i,v.size()){if(i)os<<" ";os<<v[i];}return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
REP(i,v.size()){if(i)os<<endl;os<<v[i];}return os;}

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


  ll M = 1;
  
  rep(i, N) M *= A[i];
  
   --M;



   ll f(ll n, A) return n % A;


   ll ans = 0;


   rep(i, N) ans += f(M, A[i]);


   cout << ans << endl;



  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:15: error: 'A' is not a type
   36 |    ll f(ll n, A) return n % A;
      |               ^
a.cc:36:18: error: a function-definition is not allowed here before 'return'
   36 |    ll f(ll n, A) return n % A;
      |                  ^~~~~~
a.cc:42:21: error: 'f' was not declared in this scope
   42 |    rep(i, N) ans += f(M, A[i]);
      |                     ^
Language: C++

typedef long long ll;
using namespace std;

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

  ll res = 0;
  int a;
  for (int i = 0; i < n; i++)
  {
    cin >> a;
    res += a - 1;
  }

  cout << res << endl;
}

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:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | typedef long long ll;
a.cc:17:3: error: 'cout' was not declared in this scope
   17 |   cout << res << endl;
      |   ^~~~
a.cc:17:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:17:18: error: 'endl' was not declared in this scope
   17 |   cout << res << endl;
      |                  ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | typedef long long ll;
Language: C++

#include<bits/stdc++.h>
#define int long long
int a[114514]
using namespace std;
signed main(){
  int n;
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>a[i];
  }
  int seki=1;
  for(int i=0;i<n;i++){
    seki=seki*a[i];
  }
  int ans=-810;
  int sum=0;
  for(int i=0;i<seki;i++){
    sum=0;
    for(int j=0;j<n;j++){
      sum+=i%a[j];
    }
    if(sum>ans){
      ans=sum;
    }
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc:4:1: error: expected initializer before 'using'
    4 | using namespace std;
      | ^~~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   cin>>n;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:9:10: error: 'a' was not declared in this scope
    9 |     cin>>a[i];
      |          ^
a.cc:13:15: error: 'a' was not declared in this scope
   13 |     seki=seki*a[i];
      |               ^
a.cc:20:14: error: 'a' was not declared in this scope
   20 |       sum+=i%a[j];
      |              ^
a.cc:26:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   26 |   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:26:14: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   26 |   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++

int a,A;main(){std::cin>>A;while(std::cin>>A)a+=A-1;std::cout<<a;}

Compiler output:
a.cc:1:9: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | int a,A;main(){std::cin>>A;while(std::cin>>A)a+=A-1;std::cout<<a;}
      |         ^~~~
a.cc: In function 'int main()':
a.cc:1:21: error: 'cin' is not a member of 'std'
    1 | int a,A;main(){std::cin>>A;while(std::cin>>A)a+=A-1;std::cout<<a;}
      |                     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | int a,A;main(){std::cin>>A;while(std::cin>>A)a+=A-1;std::cout<<a;}
a.cc:1:39: error: 'cin' is not a member of 'std'
    1 | int a,A;main(){std::cin>>A;while(std::cin>>A)a+=A-1;std::cout<<a;}
      |                                       ^~~
a.cc:1:39: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:1:58: error: 'cout' is not a member of 'std'
    1 | int a,A;main(){std::cin>>A;while(std::cin>>A)a+=A-1;std::cout<<a;}
      |                                                          ^~~~
a.cc:1:58: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: Java

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

public class C103 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        
        int a[] = new int[n];
        for(int i = 0; i < n; i++){
            a[i] = Integer.parseInt(sc.next());
        }

        int sum = 0;
        for(int i = 0; i < n; i++){
            sum += a[i] - 1;
        }

        System.out.println(sum);
        
        sc.close();
    }
}

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

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

public class C103 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        
        int a[] = new int[n];
        for(int i = 0; i < n; i++){
            a[i] = Integer.parseInt(sc.next());
        }

        int sum = 0;
        int max = Integer.MIN_VALUE;

        for (int i = 2; i <= 3000; i++) {
            sum = 0;
            for(int j = 0; j < n; j++){
                sum += i % a[j];
                // System.out.println(sum);
            }
            // System.out.println(max);
            if(sum > max){
                max = sum;
            }
        }

        System.out.println(max);
        
        sc.close();
    }
}

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

#include <iostream>
#include <numeric>
#include <string>
#include <algorithm>
#include <vector>
#include <cstdlib>
#include <cmath>
#include <utility>
#include <functional>

#define repd(i,a,b); for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define ll long long int
 
 
using namespace std;
int main() {
  int n,sum=0; cin >> n;
  int a[n]; 
  rep(i,n){
    cin >> a[i];
    sum += a[i];
  }
  cout sum-n;
 
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:7: error: expected ';' before 'sum'
   24 |   cout sum-n;
      |       ^~~~
      |       ;
Language: C++

#include<iostream>
#include<map>
#include<vector>
using namespace std;
int main(){
	int N;
	cin >> N;
  	int c;
	vector<int> a;
  	rep(i,N){
      cin >> c;
      a.push_back(c);
    }
  
	long long sum = 0;
	for(auto x:a) sum+=x-1;
	cout << sum << endl;
}


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

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

int mian(){
  int n;
  cin >> n;
  vector<int> v(n);
  for(int i = 0; i < n; i++){
    cin >> v[i];
  }
  
  sort(v.begin(), v.end());
  
  int a, b;
  a = v[0];
  b = v[v.size()-1];
  
  int num = 0;
  int i = 1;
  int j = 0;
  while(true){
    num = b*i-j
    if(num % a == a-1){
      break;
    }
    else if(num % b != 0){
      j--;
    }
    else {
      i++;
    }
  }
  
  int ans = 0;
  for(int i = 0; i < n; i++){
    ans += num % v[i];
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int mian()':
a.cc:13:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   13 |   sort(v.begin(), v.end());
      |   ^~~~
      |   short
a.cc:23:16: error: expected ';' before 'if'
   23 |     num = b*i-j
      |                ^
      |                ;
   24 |     if(num % a == a-1){
      |     ~~          
a.cc:27:5: error: 'else' without a previous 'if'
   27 |     else if(num % b != 0){
      |     ^~~~
Language: C++

#include <vector>
#include <iostream>
#include <cmath>
#include <string>
#include <cstring>
#include <algorithm>
#include <numeric>
#include <cstdlib>
using namespace std;
typedef long long ll;

int main(){
  int n;
  cin >> n;
  int ans = 0;
  for(int i=0;i<n;i++) {
    int value;
    cin >> value;
    ans += value -1;
  }

  cout << value << endl;
  return 0;
}


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

#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        n: usize,
        a: [usize; n],
    }

    let ans = a.iter().fold(0, |sum, x| sum + x - 1);
    println!("{}", ans);
}


Compiler output:
a.cc:1:2: error: invalid preprocessing directive #[
    1 | #[allow(unused_macros)]
      |  ^
a.cc:23:2: error: invalid preprocessing directive #[
   23 | #[allow(unused_macros)]
      |  ^
a.cc:39:2: error: invalid preprocessing directive #[
   39 | #[allow(unused_macros)]
      |  ^
a.cc:46:10: error: too many decimal points in number
   46 |         (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
      |          ^~~~~~~
a.cc:2:1: error: 'macro_rules' does not name a type
    2 | macro_rules! input {
      | ^~~~~~~~~~~
a.cc:24:1: error: 'macro_rules' does not name a type
   24 | macro_rules! input_inner {
      | ^~~~~~~~~~~
a.cc:40:1: error: 'macro_rules' does not name a type
   40 | macro_rules! read_value {
      | ^~~~~~~~~~~
a.cc:66:1: error: 'fn' does not name a type
   66 | fn main() {
      | ^~
Language: C

int n, a, ans, i;
int main(){
  scanf("%d", &n);
  for(i=0; i<n; i++){
    scanf("%d", &a);
    ans=+=a;
  }
  printf("%d\n", ans-n);
}


Compiler output:
main.c: In function 'main':
main.c:3:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    3 |   scanf("%d", &n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int n, a, ans, i;
main.c:3:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    3 |   scanf("%d", &n);
      |   ^~~~~
main.c:3:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:6:9: error: expected expression before '+=' token
    6 |     ans=+=a;
      |         ^~
main.c:8:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    8 |   printf("%d\n", ans-n);
      |   ^~~~~~
main.c:8:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:8:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:8:3: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:16: error: expected ';' before ')' token
    6 |   for(i,i<n;++i)r+=(cin>>a);
      |                ^
      |                ;
a.cc:6:18: error: no match for 'operator+=' (operand types are 'int' and 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'})
    6 |   for(i,i<n;++i)r+=(cin>>a);
      |                 ~^~~~~~~~~~
a.cc:6:18: note: candidate: 'operator+=(int&, int)' (built-in)
a.cc:6:18: note:   no known conversion for argument 2 from 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} to 'int'
Language: C++

#include <iostream>
#include <string>

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:32: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |   for(int i=1; i<N+1; i++) std:cin>>a[i];
      |                                ^~~
      |                                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
      |                  ^~~
Language: C++

#include<iostream>
using namespace std;
int main(){
  int b[10000];
  int n,count=0;
  cin>>n
  for(int i=0;i<n;i++){
    cin>>b[i];
    count+=b[i];
  }
  cout<<count-n<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: expected ';' before 'for'
    6 |   cin>>n
      |         ^
      |         ;
    7 |   for(int i=0;i<n;i++){
      |   ~~~    
a.cc:7:15: error: 'i' was not declared in this scope
    7 |   for(int i=0;i<n;i++){
      |               ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
a.cc:5:3: note: in expansion of macro 'll'
    5 |   ll n,c=0,a;
      |   ^~
a.cc:5:6: error: 'n' was not declared in this scope; did you mean 'yn'?
    5 |   ll n,c=0,a;
      |      ^
      |      yn
a.cc:5:8: error: 'c' was not declared in this scope
    5 |   ll n,c=0,a;
      |        ^
a.cc:5:12: error: 'a' was not declared in this scope
    5 |   ll n,c=0,a;
      |            ^
a.cc:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
a.cc:7:7: note: in expansion of macro 'll'
    7 |   for(ll i=0;i<n;i++){
      |       ^~
a.cc:7:10: error: 'i' was not declared in this scope
    7 |   for(ll i=0;i<n;i++){
      |          ^
a.cc:7:17: error: expected ')' before ';' token
    7 |   for(ll i=0;i<n;i++){
      |      ~          ^
      |                 )
a.cc:7:18: error: 'i' was not declared in this scope
    7 |   for(ll i=0;i<n;i++){
      |                  ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long;
ll gcd(ll a,ll b){
  if(a<b) swap(a,b);
  ll c;
  c=a%b;
  a=b;
  b=c;
  if(b!=0)
    a=gcd(a,b);
  return a;
}
ll lcm(ll a,ll b){
  return a*b/gcd(a,b);
}
int main(){
  

Compiler output:
a.cc:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
a.cc:4:1: note: in expansion of macro 'll'
    4 | ll gcd(ll a,ll b){
      | ^~
a.cc:3:21: error: expected ')' before ';' token
    3 | #define ll long long;
      |                     ^
a.cc:4:8: note: in expansion of macro 'll'
    4 | ll gcd(ll a,ll b){
      |        ^~
a.cc:4:7: note: to match this '('
    4 | ll gcd(ll a,ll b){
      |       ^
a.cc:3:21: error: expected constructor, destructor, or type conversion before ';' token
    3 | #define ll long long;
      |                     ^
a.cc:4:8: note: in expansion of macro 'll'
    4 | ll gcd(ll a,ll b){
      |        ^~
a.cc:4:11: error: 'a' does not name a type
    4 | ll gcd(ll a,ll b){
      |           ^
a.cc:4:16: error: 'b' does not name a type
    4 | ll gcd(ll a,ll b){
      |                ^
a.cc:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
a.cc:14:1: note: in expansion of macro 'll'
   14 | ll lcm(ll a,ll b){
      | ^~
a.cc:3:21: error: expected ')' before ';' token
    3 | #define ll long long;
      |                     ^
a.cc:14:8: note: in expansion of macro 'll'
   14 | ll lcm(ll a,ll b){
      |        ^~
a.cc:14:7: note: to match this '('
   14 | ll lcm(ll a,ll b){
      |       ^
a.cc:3:21: error: expected constructor, destructor, or type conversion before ';' token
    3 | #define ll long long;
      |                     ^
a.cc:14:8: note: in expansion of macro 'll'
   14 | ll lcm(ll a,ll b){
      |        ^~
a.cc:14:11: error: 'a' does not name a type
   14 | ll lcm(ll a,ll b){
      |           ^
a.cc:14:16: error: 'b' does not name a type
   14 | ll lcm(ll a,ll b){
      |                ^
a.cc: In function 'int main()':
a.cc:17:12: error: expected '}' at end of input
   17 | int main(){
      |           ~^
Language: C++

#include<iostream>
using namespace std;

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


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

int n, in, sum = 0; cin >> n;
rep(i, n) {
    cin >> in; sum += in;
}
cout << sum - n;

Compiler output:
a.cc:1:21: error: 'cin' does not name a type
    1 | int n, in, sum = 0; cin >> n;
      |                     ^~~
a.cc:2:4: error: expected constructor, destructor, or type conversion before '(' token
    2 | rep(i, n) {
      |    ^
a.cc:5:1: error: 'cout' does not name a type
    5 | cout << sum - n;
      | ^~~~
Language: C++

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

using namespace std;
typedef int long long;
#define rep(i,n) for(int i=0;i<n;++i)

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

}
int main(){
	int n;
	cin >> n;
	long long int lcm = 1;
	vector<int>a(n);
	rep(i, n)
		cin >> a[i];
	rep(i, n){
		lcm = lcm*a[i] / gcd(lcm, a[i]);
	}
	long long int ans=0;
	cout << lcm << endl;
	rep(i, n){
		ans += lcm%a[i];
	}
	cout << ans << endl;
}

Compiler output:
a.cc:9:18: error: declaration does not declare anything [-fpermissive]
    9 | typedef int long long;
      |                  ^~~~
Language: C++

#include<iostream>

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

  

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    4 |   int N;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<<sum-N<<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<<sum-N<<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>
#define endl '\n'

using namespace std;

int main(void)
{
  cin.tie(NULL); ios_base::sync_with_stdio(false);
  int N; cin >> N;
  ll acc = 0;
  ll temp;
  while(N--)
  {
    cin >> temp;
    acc += temp - 1;
  }
  cout << acc << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'll' was not declared in this scope
   10 |   ll acc = 0;
      |   ^~
a.cc:11:5: error: expected ';' before 'temp'
   11 |   ll temp;
      |     ^~~~~
      |     ;
a.cc:14:12: error: 'temp' was not declared in this scope; did you mean 'tm'?
   14 |     cin >> temp;
      |            ^~~~
      |            tm
a.cc:15:5: error: 'acc' was not declared in this scope
   15 |     acc += temp - 1;
      |     ^~~
a.cc:17:11: error: 'acc' was not declared in this scope
   17 |   cout << acc << endl;
      |           ^~~
Language: C++

#include<stdio.h>
int main(){

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

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

#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define EACH(i, c) for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) sort((c).begin(), (c).end())
#define dump(x) cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \
                      << " " << __FILE__ << endl;
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define ll long long

using namespace std;
int calc_sum(int m, vector<int> a){
    int sum = 0;
    for (int num : a){
        sum  += m%num;
    }
    return sum;
}

signed main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n;
    cin >> n;
    vector<int> a;
    int num;
    REP(_,n){
        cin >> num;
        a.PB(num-1);
    }

    cout << accummlate(ALL(a),0);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:13: error: 'accummlate' was not declared in this scope
   40 |     cout << accummlate(ALL(a),0);
      |             ^~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;
const int MOD = 1000000007;
const int INF = 1010000000;
const double EPS = 1e-10;
using namespace std;
//cout << fixed << setprecision(0)

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

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

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


Compiler output:
a.cc:11:15: error: 'b' has not been declared
   11 | int gcd(int a,b){
      |               ^
a.cc: In function 'int gcd(int, int)':
a.cc:12:6: error: 'b' was not declared in this scope
   12 |   if(b==0)return a;
      |      ^
a.cc:13:14: error: 'b' was not declared in this scope
   13 |   return gcd(b,a%b);
      |              ^
a.cc: At global scope:
a.cc:16:15: error: 'b' has not been declared
   16 | int lcm(int a,b){
      |               ^
a.cc: In function 'int lcm(int, int)':
a.cc:17:12: error: 'b' was not declared in this scope
   17 |   return a*b/gcd(a,b);
      |            ^
Language: C++

#include <bits/stdc++.h>
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;
const int MOD = 1000000007;
const int INF = 1010000000;
const double EPS = 1e-10;
using namespace std;
//cout << fixed << setprecision(0)

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

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

int main() { 
  int n;cin >> n;
  int ans,pre,now;
  cin >> pre >> now;
  ans = lcm(pre,now);
  rep(i,n-2){
    pre = now;
    cin >> now;
    ans = lcm(now,ans);
  }
  cout << ans-1 << endl;
}


Compiler output:
a.cc:11:15: error: 'b' has not been declared
   11 | int gcd(int a,b){
      |               ^
a.cc: In function 'int gcd(int, int)':
a.cc:12:6: error: 'b' was not declared in this scope
   12 |   if(b==0)return a;
      |      ^
a.cc:13:14: error: 'b' was not declared in this scope
   13 |   return gcd(b,a%b);
      |              ^
a.cc: At global scope:
a.cc:16:15: error: 'b' has not been declared
   16 | int lcm(int a,b){
      |               ^
a.cc: In function 'int lcm(int, int)':
a.cc:17:12: error: 'b' was not declared in this scope
   17 |   return a*b/gcd(a,b);
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
using long long ll;
const int INF = 1e8;
int main() {
	int N;
	int A;
	cin >> N;
	int sum = 0;
	for (int i = 0; i < N; i++) {
		cin >> A;
		sum += A - 1;
	}
	cout << sum << endl;
	return 0;
}

Compiler output:
a.cc:3:7: error: expected nested-name-specifier before 'long'
    3 | using long long ll;
      |       ^~~~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'sum' was not declared in this scope
   11 |         sum+=a;
      |         ^~~
Language: C++

#include <iostream>
using namespace std;
typedef long long
int main(void){
    // Your code here!
    ll n;
    ll ans=0;
    cin>>n;
    for(int i=0;i<n;i++){
        int a;
        cin>>a;
        ans+=a;
    }
    cout<<ans-n<<endl;
}


Compiler output:
a.cc:4:5: error: typedef may not be a function definition
    4 | int main(void){
      |     ^~~~
Language: C++

#include <iostream>
#include <numeric>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <iterator>
#include <math.h>
#include <cmath>
#include <deque>
#include <limits>
#include <numeric>

#define INF 100000000
#define MOD 1000000007

#define ll long long


ll gcd(ll x, ll y);  // 最大公約数を求める関数
ll lcm(ll x, ll y);  // 最小公倍数を求める関数

using namespace std;

ll main() {

	ll n, max;

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

	for (int i = 1; i < n; i++) {
		max = lcm(max, a[i]);

	}
	
	ll ans = 0;

	for (int i = 0; i < n; i++)
	{
		ans += (max - 1) % a[i];
	}
	
	cout << ans << endl;
}

ll gcd(ll x, ll y)
{
	ll r;

	if (x == 0 || y == 0)  // 引数チェック
	{
		fprintf(stderr, "引数エラーです。\n");
		return 0;
	}

	// ユーグリッドの互除法
	while ((r = x % y) != 0) // yで割り切れるまでループ
	{
		x = y;
		y = r;
	}
	return y;
}

// 最大公約数を求める関数
ll lcm(ll x, ll y)
{
	if (x == 0 || y == 0)  // 引数チェック
	{
		fprintf(stderr, "引数エラーです。\n");
		return 0;
	}

	return (x * y / gcd(x, y));
}

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

#include<stdio.h>
int main()
{
int n,i,sum=0,a;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&a);
sum+=a;
}
ans=sum-n;
printf("%d\n",ans);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:1: error: 'ans' undeclared (first use in this function)
   11 | ans=sum-n;
      | ^~~
main.c:11:1: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

 #include <iostream>
 using namespace std;

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


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

#include <iostream>

using namespace std;

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

   int M = 0;
   for (int i = 0; i < N; i++){
       M += a[i] - 1;
   }
   cout << M << endl;
}

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

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

using namespace std;

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

   int M = 0;
   for (int i = 0; i < N; i++){
       M += a[i] - 1;
   }
   cout << M << endl;
}

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

import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;

public class Main3 {
	public static void main(String[] args){
		FastScanner sc = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);
		int N = sc.nextInt();
		long res = 0;
		for(int i=0;i<N;i++){
			res += sc.nextInt() - 1;
		}
		out.println(res);
		out.flush();
	}
}


class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble() { return Double.parseDouble(next());}
}

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

#include<iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:15:11: error: expected ';' before '}' token
   15 |   return 0
      |           ^
      |           ;
   16 | }
      | ~
Language: Java

import java.util.*;
public class B103{
    public static void main(String[] args) {
        new Main().run();
    }

    void run() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int result = 0;

        for(int i=0; i<N; i++){
            result += sc.nextInt()-1;
        }
        System.out.println(result);
    }
}


Compiler output:
Main.java:2: error: class B103 is public, should be declared in a file named B103.java
public class B103{
       ^
Main.java:4: error: cannot access Main
        new Main().run();
            ^
  bad source file: ./Main.java
    file does not contain class Main
    Please remove or make sure it appears in the correct subdirectory of the sourcepath.
2 errors
Language: C++

#include <bits/stdc++.h>

using namespace std;

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

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

#include<iostream>
int main(){int N,A,a=0;std::cin>>N;while(N--){std::cin>>A;a+=A-1;}std::cout<<a<<endl;}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:81: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    2 | int main(){int N,A,a=0;std::cin>>N;while(N--){std::cin>>A;a+=A-1;}std::cout<<a<<endl;}
      |                                                                                 ^~~~
      |                                                                                 std::endl
In file included from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
int main(){int N,A,a=0;std::cin>>N;while(N--){cin>>A;a+=A-1;}std::cout<<a<<endl;}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:47: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    2 | int main(){int N,A,a=0;std::cin>>N;while(N--){cin>>A;a+=A-1;}std::cout<<a<<endl;}
      |                                               ^~~
      |                                               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:2:76: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    2 | int main(){int N,A,a=0;std::cin>>N;while(N--){cin>>A;a+=A-1;}std::cout<<a<<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<string>
using namespace std;
int solve(int arr[],int n,int x)
{
	int tmp=0;
	for(int i=0;i<n;i++)
	{
		tmp+=x%arr[i];
	}
	return tmp;
}
int main()
{
	int n;
	cin>>n;
	int arr[n];
	long int ans=0;
		int mi=INT_MAX;
	int ma=INT_MIN;
	for(int i=0;i<n;i++)
	{
		cin>>arr[i];
		ans+=arr[i]-1;
	}
	cout<<ans<<"\n";
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:24: error: 'INT_MAX' was not declared in this scope
   19 |                 int mi=INT_MAX;
      |                        ^~~~~~~
a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    1 | #include<iostream>
  +++ |+#include <climits>
    2 | #include<string>
a.cc:20:16: error: 'INT_MIN' was not declared in this scope
   20 |         int ma=INT_MIN;
      |                ^~~~~~~
a.cc:20:16: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

#include<stdio.h>
int main(void)
{
        int i,a[100],n,s=0;
        scanf("%d",&n);
        for(i=0;i<n;i++){
                scanf("%d",&a[i]);
                if(i==0) max=a[i];
                if(a[i]>max) max=a[i];
        }
        for(i=0;i<n;i++){
                s+=(2*max)%a[i];
        }
        printf("%d\n",s+max-1);
        return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:26: error: 'max' was not declared in this scope
    8 |                 if(i==0) max=a[i];
      |                          ^~~
a.cc:9:25: error: 'max' was not declared in this scope
    9 |                 if(a[i]>max) max=a[i];
      |                         ^~~
a.cc:12:23: error: 'max' was not declared in this scope
   12 |                 s+=(2*max)%a[i];
      |                       ^~~
a.cc:14:25: error: 'max' was not declared in this scope
   14 |         printf("%d\n",s+max-1);
      |                         ^~~
Language: C++

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

void check_array(int*, int);


int main() {

//	bool is_Debug = true;
//	Log_csv Log("log.csv");

	int N; 
	cin >> N;
	int* integer = new int[N];
	for (int i = 0; i < N; i++) {
		cin >> integer[i];
	}
	sort(integer, integer + N);
//	if(is_Debug) Log.WriteArray(integer, N);
	int min_range = integer[0];
	int max_range = 100000;
	int answer = 0;
	
	for (int num_divided = 2147483647; num_divided > min_range + 1; num_divided--) {
		int tmp = 0;
//		if (is_Debug) {
//			Log.Write("num_divided:"); Log.Write(num_divided);
//			Log.NextLine();
//		}
		for (int i = 0; i < N; i++) {
			tmp += num_divided % integer[i];
//			if (is_Debug) Log.Write(num_divided % integer[i]);
		}
//		if (is_Debug) {
//			Log.NextLine();
//			Log.Write("answer:"); Log.Write(answer); Log.NextLine();
//			Log.Write("tmp:"); Log.Write(tmp); Log.NextLine();
//		}
		if (answer < tmp)answer = tmp;
	}
	
	cout << answer << endl;
	
	delete [] integer;
	return 0;
}

void check_array(int* array, int array_size) {
	cout << "配列の中身" << endl;
	for (int i = 0; i < array_size; i++) {
		cout << array[i] << endl;
	}
}

Compiler output:
a.cc:3:10: fatal error: Log_csv.h: No such file or directory
    3 | #include "Log_csv.h"
      |          ^~~~~~~~~~~
compilation terminated.
Language: Java

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



public class Main{
  
 public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int[] as = new int[N];
        int sum = 0;
        for(int i = 0; i < N;i++){
            as[i]=scanner.nextInt();
            sum += as[i]
        }
        sum -= N;
        System.out.println(sum);
    } 
  
  
  
  
  
}

Compiler output:
Main.java:15: error: ';' expected
            sum += as[i]
                        ^
1 error
Language: C

# include <stdio.h>
int main (){
int n;
int a;
while (scanf ("%d",&n)==1&&n){
int sum=0; 
while (n--)
{
scanf ("%d", &a);
sum+=a-1;}
printf ("%d\n",sum);
}

Compiler output:
main.c: In function 'main':
main.c:12:1: error: expected declaration or statement at end of input
   12 | }
      | ^
Language: C

# include <stdio.h>
int main (){
int n;
iny a;
while (scanf ("%d",&n)==1&&n){
int sum=0; 
while (n--)
{
scanf ("%d", &a);
sum+=a-1;}
printf ("%d\n",sum);
}

Compiler output:
main.c: In function 'main':
main.c:4:1: error: unknown type name 'iny'; did you mean 'int'?
    4 | iny a;
      | ^~~
      | int
main.c:12:1: error: expected declaration or statement at end of input
   12 | }
      | ^
Language: C

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


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

import sys
import math
import numpy as np
import itertools


# ひとつ入力
n = int(input())
# リストに入れる
a = [int(i) for i in input().split()] 
answer=0
for i in range(n):
    answer += (a[i]-1)

print(answer)



Compiler output:
a.cc:7:3: error: invalid preprocessing directive #\U00003072\U00003068\U00003064\U00005165\U0000529b
    7 | # ひとつ入力
      |   ^~~~~~~~~~
a.cc:9:3: error: invalid preprocessing directive #\U000030ea\U000030b9\U000030c8\U0000306b\U00005165\U0000308c\U0000308b
    9 | # リストに入れる
      |   ^~~~~~~~~~~~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import sys
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'