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

#include <iostream>
using namespace std;



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

    int prime[25] = {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97};
    int count[25];

    memset(count,0,sizeof(count));

    for(int i=1; i <= N; i++){
        for(int j=0; j<25; j++){
            int cur = i;
            int prime_tmp = prime[j];
            while (cur % prime_tmp == 0){
                cur /= prime_tmp;
                count[j] += 1;
            }
        }
    }

    int ans = 0;

    //1: 2*24 //
    int c_2 = 0;
    int c_24 = 0;
    for(int j=0; j<25; j++){
        if(count[j] > 2){c_2++;}
        if(count[j] > 24){c_24++;}
    }

    ans += (c_2-1) * c_24;

    //2: 2*4*4 //
    c_2 = 0;
    int c_4 = 0;
    for(int j=0; j<25; j++){
        if(count[j] > 2){c_2++;}
        if(count[j] > 4){c_4++;}
    }

    ans += (c_2-2) * (c_4*(c_4-1)/2);

    cout << ans << endl;

    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'memset' was not declared in this scope
   13 |     memset(count,0,sizeof(count));
      |     ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C++

#include <iostream>
using namespace std;



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

    int prime[25] = {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97};
    int count[25];

    memset(count,0,sizeof(count));

    for(int i=1; i <= N; i++){
        for(int j=0; j<25; j++){
            int cur = i;
            int prime_tmp = prime[j];
            while (cur % prime_tmp == 0){
                cur /= prime_tmp;
                count[j] += 1;
            }
        }
    }

    int ans = 0;

    //1: 2*24 //
    int c_2 = 0;
    int c_24 = 0;
    for(int j=0; j<25; j++){
        if(count[j] > 2){c_2++;}
        if(count[j] > 24){c_24++;}
    }

    ans += (c_2-1) * c_24;

    //2: 2*4*4 //
    int c_2 = 0;
    int c_4 = 0;
    for(int j=0; j<25; j++){
        if(count[j] > 2){c_2++;}
        if(count[j] > 4){c_4++;}
    }

    ans += (c_2-2) * (c_4*(c_4-1)/2);

    cout << ans << endl;

    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'memset' was not declared in this scope
   13 |     memset(count,0,sizeof(count));
      |     ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
a.cc:39:9: error: redeclaration of 'int c_2'
   39 |     int c_2 = 0;
      |         ^~~
a.cc:29:9: note: 'int c_2' previously declared here
   29 |     int c_2 = 0;
      |         ^~~
Language: C++

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

std::vector<int> factorialSmallerN(int N)
{
    std::vector<int> e(N, 0);
    std::vector<int> p = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97};
    for(int i = 2; i <= N; i++)
    {
        int cur = i;
        for(int j = 0; j < p.size(); j++)
        {
            while( cur % p[j] == 0)
            {
                e[p[j]]++;
                cur = cur / p[j];
            }
        }
    }
    return e;
}

long getLargeDivisor(int th, std::vector<int> d_vec)
{
    return std::count_if(d_vec.begin(), d_vec.end(), [=](int x){return x >= th;});
}

int main()
{
//    int N = 0;
//    cin >> N;
    int N = 6;
    long ret = 0;
    auto d_vec = factorialSmallerN(N);
    ret = getLargeDivisor(74, d_vec);
    ret += getLargeDivisor(24, d_vec) * (getLargeDivisor(2, d_vec) - 1);
    ret += getLargeDivisor(14, d_vec) * (getLargeDivisor(4, d_vec) - 1);
    ret += getLargeDivisor(4, d_vec) * (getLargeDivisor(4, d_vec) - 1) * (getLargeDivisor(2, d_vec) - 2) / 2;
    cout << ret;
    return 0;
}


Compiler output:
a.cc: In function 'long int getLargeDivisor(int, std::vector<int>)':
a.cc:27:17: error: 'count_if' is not a member of 'std'
   27 |     return std::count_if(d_vec.begin(), d_vec.end(), [=](int x){return x >= th;});
      |                 ^~~~~~~~
Language: C++

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

std::vector<int> factorialSmallerN(int N)
{
    std::vector<int> e(N, 0);
    std::vector<int> p = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97};
    for(int i = 2; i <= N; i++)
    {
        int cur = i;
        for(int j = 0; j < p.size(); j++)
        {
            while( cur % p[j] == 0)
            {
                e[p[j]]++;
                cur = cur / p[j];
            }
        }
    }
    return e;
}

long getLargeDivisor(int th, std::vector<int> d_vec)
{
    return std::count_if(d_vec.begin(), d_vec.end(), [=](int x){return x >= th;});
}

int main()
{
    int N = 0;
    cin >> N;
    long ret = 0;
    auto d_vec = factorialSmallerN(N);
    ret = getLargeDivisor(75, d_vec);
    ret += getLargeDivisor(24, d_vec) * (getLargeDivisor(2, d_vec) - 1);
    ret += getLargeDivisor(14, d_vec) * (getLargeDivisor(4, d_vec) - 1);
    ret += getLargeDivisor(4, d_vec) * (getLargeDivisor(4, d_vec) - 1) * (getLargeDivisor(2, d_vec) - 2) / 2;
    cout << ret;
    return 0;
}


Compiler output:
a.cc: In function 'long int getLargeDivisor(int, std::vector<int>)':
a.cc:27:17: error: 'count_if' is not a member of 'std'
   27 |     return std::count_if(d_vec.begin(), d_vec.end(), [=](int x){return x >= th;});
      |                 ^~~~~~~~
Language: C++


#include<algorithm>
#include<iostream>
#include<vector>
#include<string>
#include<cstring>
#include<utility>
#include<queue>
#include<map>
#include<cmath>
using namespace std;
#define REP(i, a,b) for(i=a;i<b;i++) 
#define REP1(i,b,a) for(i=b-1;i>=a;i--)
#define output(x) cout<<x<<endl;
#define pb(x) push_back(x);
typedef long long int ll;
const int MAX = 510000;
const int MOD = 1000000007;

int main()
{

	ll i, j, k, l, m, flag, N, M, K, H, W, X, P;
	cin >> N;
	//エラトステネスの篩で素数をnまで列挙
	n = 100;

	ll prime[105] = {};
	bool is_prime[105];
	ll primecc[105] = {};//i番目の素数を何個素因数に持つか
	for (i = 0; i <= n; i++) {
		is_prime[i] = true;
	}
	int p = 0;
	is_prime[0] = is_prime[1] = false;
	for (i = 2; i <= n; i++) {
		if (is_prime[i]) {
			prime[p++] = i;
			for (j = 2 * i; j <= n; j += i) {
				is_prime[j] = false;
			}
		}
	}
	//ここからPの素因数分解
	for (P = 2; P <= N; P++) {
		k = 0;
		ll temp;
		for (i = 0; prime[i] * prime[i] <= P; i++) {
			temp = P;
			while (P%prime[i] == 0) {
				P /= prime[i];
				primecc[i]++;
			}
			P = temp;
		}
	}
	ll ans = 0;
	ll cc24, cc2, cc4, cc14;
	cc24 = 0;
	cc2 = 0;
	cc4 = cc14 = 0;
	for (i = 0;prime[i]<=N; i++) {
		if (primecc[i] >= 74) {
			ans++;
		}
		if (primecc[i] >= 24) {
			cc24++;
		}
		if (primecc[i] >= 14) {
			cc14++;
		}
		if (primecc[i] >= 4) {
			cc4++;
		}
		if (primecc[i] >= 2) {
			cc2++;
		}
	}
	ans += cc24 * (cc2 - 1)+cc14*(cc4-1)+((cc4*(cc4-1))/2*(cc2-2));
	output(ans);
	return 0;
}





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

#include <iostream>

using namespace std;

int primes[100];

int get_primes(int n) {
    for (int i = 2; i <= n; i++) {
        bool flag = true;
        for (int j = 2; j <= i; j++) {
            if (i % j == 0 && i != j) {
                flag = false;
                break;
            }
        }
        if (flag) {
            cnt++;
            primes[k++] = i;
        }
    }
    return cnt;
}

int main() {
    int n, cnt, ans = 0;
    int exps[100] = {0};

    cin >> n;

    cnt = get_primes(n);

    for (int i = 2; i <= n; i++) {
        int k = i;
        for (int j = 0; j < cnt; j++) {
            while (k % primes[j] == 0) {
                exps[j]++;
                k /= primes[j];
            }
        }
    }

    // p^74
    for (int i = 0; i < cnt; i++) {
        if (exps[i] >= 74) { ans++; }
    }

    for (int i = 0; i < cnt; i++) {
        for (int j = 0; j < cnt; j++) {
            if (i == j) { continue; }
            // p^2 * q^24
            if (exps[i] >= 2 && exps[j] >= 24) {
                ans++;
            }
            // p^4 * q^14
            if (exps[i] >= 4 && exps[j] >= 14) {
                ans++;
            }
        }
    }

    // p^2 * q^4 * r^4
    for (int i = 0; i < cnt; i++) {
        for (int j = 0; j < cnt; j++) {
            for (int k = j+1; k < cnt; k++) {
                if (i == j || i == k || j == k) { continue; }
                if (exps[i] >= 2 && exps[j] >= 4 && exps[k] >= 4) {
                     ans++;
                }
            }
        }
    }

    cout << ans << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int get_primes(int)':
a.cc:17:13: error: 'cnt' was not declared in this scope; did you mean 'int'?
   17 |             cnt++;
      |             ^~~
      |             int
a.cc:18:20: error: 'k' was not declared in this scope
   18 |             primes[k++] = i;
      |                    ^
a.cc:21:12: error: 'cnt' was not declared in this scope; did you mean 'int'?
   21 |     return cnt;
      |            ^~~
      |            int
Language: C++

#include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<stdio.h>
#include<set>
#include<vector>
using namespace std;


int main(){
    int n;
    cin>>n;
    
    vector<pair<int,int>> v;
    v.push_back(make_pair(2,1));
    for(int i=3;i<=n;i++){
        int vv=v.size();
        int flag=0;
        int ii=i;
        for(int j=0;j<vv;j++){
             if(i%v[j].first==0){
                 while(ii%v[j].first==0){
                v[j].second+=1;
                 flag=1;
                     ii=ii/v[j].first;
             }
                }
            if(j==vv-1&&flag==0){
                v.push_back(make_pair(i,1));
            }
            }
        }
    int kk[5];
    memset(kk,0,sizeof kk);
    for(int i=0;i<v.size();i++){
        
        if(v[i].second>=74){
            kk[4]+=1;
        }
        if(v[i].second>=24){
            kk[3]+=1;
        }
        if(v[i].second>=14){
            kk[2]+=1;
        }
        if(v[i].second>=4){
            kk[1]+=1;
        }
        if(v[i].second>=2){
            kk[0]+=1;
        }
    }
    int ans=0;
    ans+=kk[4];
    if(kk[3]!=0){
        ans+=kk[3]*(kk[0]-1);
    }
    if(kk[2]!=0){
    ans+=kk[2]*(kk[1]-1);
    }
    
    
  /*  if(kk[1]==2){
        ans+=kk[0];
    }*/
   
        int y=kk[0]-2;
        int j=kk[1]*(kk[1]-1)/2;

        ans+=j*y;
        
    
    cout<<ans<<endl;
   /* for(int i=0;i<v.size();i++){
        cout<<v[i].first<<v[i].second<<endl;
    }
    
    cout<<"b"<<endl;
    for(int i=0;i<5;i++){
        cout<<kk[i]<<endl;
    }*/
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:5: error: 'memset' was not declared in this scope
   36 |     memset(kk,0,sizeof kk);
      |     ^~~~~~
a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    8 | #include<vector>
  +++ |+#include <cstring>
    9 | using namespace std;
Language: C++

#include<iostream>
using namespace std;
bool prime(int a) {
	for (int i = 2;i <= sqrt(a);i++) {
		if (a%i == 0)return false;
	}
	return true;
}
int f(int a, int b) {
	int Ans = 0;
	while (a) {
		Ans += a / b;
		a /= b;
	}
	return Ans;
}
int main() {
	int n;
	cin >> n;
	int x = 0;
	int y = 0;
	int ans = 0;
	for (int i = 2;i <= n;i++) {
		if (prime(i)) {
			if (f(n, i) >= 74)x++;
		}
	}
	ans += x;
	x = 0;
	for (int i = 2;i <= n;i++) {
		if (prime(i)){
			if (f(n, i) >= 4)x++;
			if (f(n, i) >= 14)y++;
		}
	}
	ans += y * (x - 1);
	x = 0, y = 0;
	for (int i = 2;i <= n;i++) {
		if (prime(i)) {
			if (f(n, i) >= 2)x++;
			if (f(n, i) >= 24)y++;
		}
	}
	ans += y * (x - 1);
	x = 0, y = 0;
	for (int i = 2;i <= n;i++) {
		if (prime(i)) {
			if (f(n, i) >= 4)x++;
			if (f(n, i) >= 2)y++;
		}
	}
	ans += x * (x - 1)*(y - 2)/2;
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'bool prime(int)':
a.cc:4:29: error: 'sqrt' was not declared in this scope
    4 |         for (int i = 2;i <= sqrt(a);i++) {
      |                             ^~~~
Language: C++

#include <iostream>
#include <map>
using namespace std;
 
int N;
 
int main(){
	cin >> N;
	map<int,int> m;
	for(int i=2;i<=N;i++){
		int s = i;
		for(int j=2;j*j<=N;j++){
			while(s%j==0){
				m[j]++;
				s /= j;
			}
		}
		if(s!=1) m[s]++;	
	}
	int ans = 0;
	int c2 = 0,c4 = 0,c14 = 0,c24 = 0,c74 = 0;
	for(auto x:m){
		int s = x.second;
		if(s>=2) c2++;
		if(s>=4) c4++;
		if(s>=24) c24++;
		if(s>=14) c14++;
		if(s>=74) c74++;
	}
	cout << (c2-2)*c4*(c4-1)/2 + (c2-1)*c24 + (c4-1)*c14 + c74 << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:30:76: error: expected '}' at end of input
   30 |         cout << (c2-2)*c4*(c4-1)/2 + (c2-1)*c24 + (c4-1)*c14 + c74 << endl;
      |                                                                            ^
a.cc:7:11: note: to match this '{'
    7 | int main(){
      |           ^
Language: C++

#include <iostream>
using namespace std;
long long n;
long long ans=0;
long long a[101];
long long cl(long long x)
{
	for(long long  i=2;x!=1;i++)
	{
		while(x%i==0)
		{
			x/=i;
			a[i]++;
		}
	}
}
int main()
{
	cin>>n;
	memset(a,0,sizeof(a));
	for(long long i=2;i<=n;i++)
	{
		cl(i);
	}
	int x24=0,x2=0,x4=0,x14=0,x74=0;
	for(int i=2;i<=n;i++)
	{
		if(a[i]>=24)x24++;
		if(a[i]>=2)x2++;
		if(a[i]>=4)x4++;
		if(a[i]>=14)x14++;
		if(a[i]>=74)x74++;
	}
	long long ans=0;
	ans+=x74+(x2-2)*x4*(x4-1)/2+x14*(x4-1)+x24*(x2-1);
	cout<<ans;
	return 0;
}

Compiler output:
a.cc: In function 'long long int cl(long long int)':
a.cc:16:1: warning: no return statement in function returning non-void [-Wreturn-type]
   16 | }
      | ^
a.cc: In function 'int main()':
a.cc:20:9: error: 'memset' was not declared in this scope
   20 |         memset(a,0,sizeof(a));
      |         ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: Java

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Maim {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		sc.close();
		int[] p = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41,
				43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97};
		Map<Integer, Integer> map = new HashMap<Integer, Integer>();
		for(int i = 2; i <= N; i++) {
			int t = i;
			for(int k : p) {
				if(t == 1) break;
				while(t % k == 0) {
					map.merge(k, 1, (v1, v2) -> v1 + v2);
					t /= k;
				}
			}
		}
		int cnt = 0;
		int a = 0;
		int b = 0;
		int c = 0;
		int d = 0;
		int e = 0;
		for(int k : map.keySet()) {
			//System.out.println(k +" " + map.get(k));
			int t = map.get(k);
			if(t >= 74) {
				a++;
			}
			if(t >= 24) {
				b++;
			}
			if(t >= 14) {
				c++;
			}
			if(t >= 4) {
				d++;
			}
			if(t >= 2) {
				e++;
			}
		}
		//System.out.println(a);
		cnt += a;
		cnt += b * (e - 1);
		cnt += c * (d - 1);
		cnt += (d * (d - 1) * (e - 2)) / 2;
		System.out.println(cnt);
	}
}

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

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Aim {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		sc.close();
		int[] p = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41,
				43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97};
		Map<Integer, Integer> map = new HashMap<Integer, Integer>();
		for(int i = 2; i <= N; i++) {
			int t = i;
			for(int k : p) {
				if(t == 1) break;
				while(t % k == 0) {
					map.merge(k, 1, (v1, v2) -> v1 + v2);
					t /= k;
				}
			}
		}
		int cnt = 0;
		int a = 0;
		int b = 0;
		int c = 0;
		int d = 0;
		int e = 0;
		for(int k : map.keySet()) {
			//System.out.println(k +" " + map.get(k));
			int t = map.get(k);
			if(t >= 74) {
				a++;
			}
			if(t >= 24) {
				b++;
			}
			if(t >= 14) {
				c++;
			}
			if(t >= 4) {
				d++;
			}
			if(t >= 2) {
				e++;
			}
		}
		//System.out.println(a);
		cnt += a;
		cnt += b * (e - 1);
		cnt += c * (d - 1);
		cnt += (d * (d - 1) * (e - 2)) / 2;
		System.out.println(cnt);
	}
}

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

#include <iostream>

using namespace std;

bool sosuu(int n)
{
    int i = n - 1;
    while (i > 1)
    {
        if (n % i == 0)
            return false;
        i--;
    }
    return true;
}

int divide(int i, int k)
{
    int ans = 0;
    if (i <= 1)
        return ans;

    while (k % i == 0)
    {
        ans++;
        k = k / i;
    }
    return ans;
}

void calc(int N)
{
    int map[101] = {};

    for (int i = 1; i <= N; i++)
    {
        for (int j = 2; j <= i; j++)
        {
            if (sosuu(j) == true)
                map[j] += divide(j, i);
        }
    }

    int ans3 = 0, ans5 = 0, ans15 = 0, ans74 = 0;
    for (int i = 1; i <= N; i++)
    {
        if (map[i] >= 2)
            ans3++;
        if (map[i] >= 4)
            ans5++;
        if (map[i] >= 14)
            ans15++;
        if (map[i] >= 74)
            ans75++;
    }
    cout << ans75 + ans15 * ans3 + ans5 * (ans5 - 1) * (ans3 - 2) / 2 << endl;
}

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

    calc(N);
}

Compiler output:
a.cc: In function 'void calc(int)':
a.cc:54:13: error: 'ans75' was not declared in this scope; did you mean 'ans74'?
   54 |             ans75++;
      |             ^~~~~
      |             ans74
a.cc:56:13: error: 'ans75' was not declared in this scope; did you mean 'ans74'?
   56 |     cout << ans75 + ans15 * ans3 + ans5 * (ans5 - 1) * (ans3 - 2) / 2 << endl;
      |             ^~~~~
      |             ans74
Language: C++

#include <iostream>

using namespace std;

int divide(int i, int k)
{
    int ans = 0;
    if (i <= 1)
        return ans;

    while (k % i == 0)
    {
        ans++;
        k = k / i;
    }
    return ans;
}

void calc(int N)
{
    int map[101] = {};

    for (int i = 1; i <= N; i++)
    {
        for (int j = 2; j < i; j++)
        {
            map[j] += divide(j, i);
        }
    }

    int ans3 = 0, ans5 = 0, ans15 = 0, ans74 = 0;
    for (int i = 1; i <= N; i++)
    {
        if (map[i] >= 2)
            ans3++;
        if (map[i] >= 4)
            ans5++;
        if (map[i] >= 14)
            ans15++;
        if (map[i] >= 74)
            ans74++;
    }
    cout << ans74 + ans15 * ans3 + ans5 * (ans5 - 1) * (ans3 - 2) / 2 / << endl;
}

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

    calc(N);
}

Compiler output:
a.cc: In function 'void calc(int)':
a.cc:43:73: error: expected primary-expression before '<<' token
   43 |     cout << ans74 + ans15 * ans3 + ans5 * (ans5 - 1) * (ans3 - 2) / 2 / << endl;
      |                                                                         ^~
Language: C++

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


bool is_prime(int n) {
  for (int i = 2; i * i <= n; ++i) {
    if (n % i == 0) return false; 
  }
  return true;
}

int main() {
  int n;
  cin >> n;
  
  vector<int> v;
  for (int i = 2; i <= n; ++i) {
    if (!is_prime(i)) continue;
    
    int sum = 0;
    for (int k = 1; k <= n; ++k) {
      while (k % i == 0) {
        ++sum;
        k /= i;
      }
    }
    v.push_back(k + 1);
  }
  
  int ans = 0;
  for (int a : v) {
    if (a >= 75) ++ans;
  }
  
  for (int i = 0; i < v.size(); ++i) {
    for (int j = 0; j < v.size(); ++j) {
      if (v[i] >= 5 && v[j] >= 15) ++ans;
      if (v[i] >= 3 && v[j] >= 25) ++ans;
    }
  }
  
  for (int i = 0; i < v.size(); ++i) {
    for (int j = i + 1; j < v.size(); ++j) {
      for (int k = 0; k < v.size(); ++k) {
        if (v[i] >= 5 && v[j] >= 5 && v[k] >= 3) ++ans;
      }
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:17: error: 'k' was not declared in this scope
   28 |     v.push_back(k + 1);
      |                 ^
Language: C++

#include <iostream>
using namespace std;


bool is_prime(int n) {
  for (int i = 2; i * i <= n; ++i) {
    if (n % i == 0) return false; 
  }
  return true;
}

int main() {
  int n;
  cin >> n;
  
  vector<int> v;
  for (int i = 2; i <= n; ++i) {
    if (!is_prime(i)) continue;
    
    int sum = 0;
    for (int k = 1; k <= n; ++k) {
      while (k % i == 0) {
        ++sum;
        k /= i;
      }
    }
    v.push_back(k + 1);
  }
  
  int ans = 0;
  for (int a : v) {
    if (a >= 75) ++ans;
  }
  
  for (int i = 0; i < v.size(); ++i) {
    for (int j = 0; j < v.size(); ++j) {
      if (v[i] >= 5 && v[j] >= 15) ++ans;
      if (v[i] >= 3 && v[j] >= 25) ++ans;
    }
  }
  
  for (int i = 0; i < v.size(); ++i) {
    for (int j = i + 1; j < v.size(); ++j) {
      for (int k = 0; k < v.size(); ++k) {
        if (v[i] >= 5 && v[j] >= 5 && v[k] >= 3) ++ans;
      }
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:3: error: 'vector' was not declared in this scope
   16 |   vector<int> v;
      |   ^~~~~~
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:16:10: error: expected primary-expression before 'int'
   16 |   vector<int> v;
      |          ^~~
a.cc:27:5: error: 'v' was not declared in this scope
   27 |     v.push_back(k + 1);
      |     ^
a.cc:27:17: error: 'k' was not declared in this scope
   27 |     v.push_back(k + 1);
      |                 ^
a.cc:31:16: error: 'v' was not declared in this scope
   31 |   for (int a : v) {
      |                ^
a.cc:35:23: error: 'v' was not declared in this scope
   35 |   for (int i = 0; i < v.size(); ++i) {
      |                       ^
a.cc:42:23: error: 'v' was not declared in this scope
   42 |   for (int i = 0; i < v.size(); ++i) {
      |                       ^
Language: C++

#include <iostream>

using namespace std;

int divide(int i, int k)
{
    int ans = 0;
    while (k % i == 0)
    {
        ans++;
        k = k / i;
    }
    return ans;
}

void calc(int N)
{
    int map[101] = {};
    int kaijo = 1;
    for (int i = 2; i <= N; i++)
    {
        kaijo *= i;
        map[i] += divide(i, kaijo));
    }

    int ans3 = 0, ans5 = 0;
    for (int i = 1; i <= N; i++)
    {
        if (3 <= map[i])
            ans3++;
        if (5 <= map[i])
            ans5++;
    }
    cout << ans3 * ans5 * (ans5 - 1) / 2 << endl;
}

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

    calc(N);
}

Compiler output:
a.cc: In function 'void calc(int)':
a.cc:23:35: error: expected ';' before ')' token
   23 |         map[i] += divide(i, kaijo));
      |                                   ^
      |                                   ;
Language: C++

#include "bits/stdc++.h"

#pragma warning(disable:4996)
using namespace std;
using ld = long double;
ld eps=1e-9;
#define Seg_Max_N (1<<18) 

int ans=0;
int need;
int dfs(long long int num, int k,vector<int>&oks) {
	vector<int>v{ 3,5,7 };
	if(num<=need&&oks[0]&&oks[1]&&oks[2])ans++;
	if(num>=1e9)return 0;
	for (int i = 0; i < 3; ++i) {
		oks[i]++;
		dfs(num*10+v[i],k,oks);
		oks[i]--;
	}
	return 0;
}


vector<int>primes;
void hurui(const int amax) {
	static bool flag = false;
	if (flag)return;
	vector<int>sos;
	sos = vector<int>(amax + 1, true);
	sos[0] = false; sos[1] = false;
	for (int i = 2; i <= amax; ++i) {
		if (sos[i]) {
			for (int j = 2 * i; j <= amax; j += i)sos[j] = false;
		}
	}
	for (int i = 0; i <= amax; ++i) {
		if (sos[i]) {
			primes.push_back(i);
		}
	}
	flag = true;
}
map<long long int, int>soinnsuu(long long int a) {
	hurui(1000);
	map<long long int, int>ans;
	for (auto i : primes) {
		if (i> a)break;
		while (a%i == 0) {
			ans[i]++;
			a /= i;
		}
	}
	if (a != 1)ans[a]++;
	return ans;
}
int main() {

	int N;cin>>N;
	map<int,int>mp;
	for (int i = 1; i <= N; ++i) {
		auto m=soinnsuu(i);
		if (for auto a:m) {
			mp[a.first]+=a.second;
		}
	}
	vector<vector<long long int>>dp(mp.size()+1,vector<long long int>(76));
	int x=0;
	dp[0][1]=1;
	for (auto m : mp) {
		for (int i = 0; i <= 75; ++i) {
			for (int j = 1; j <= 75; ++j) {
				if (j - 1 >= m.second) {
					int k=i*j;
					if(k<=75)dp[x+1][k]+=dp[x][i];
				}
			}
		}
	}
	cout<<dp[mp.size()][75]<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:62:21: error: expected primary-expression before 'for'
   62 |                 if (for auto a:m) {
      |                     ^~~
a.cc:62:21: error: expected ')' before 'for'
   62 |                 if (for auto a:m) {
      |                    ~^~~
      |                     )
a.cc:63:28: error: 'a' was not declared in this scope
   63 |                         mp[a.first]+=a.second;
      |                            ^
Language: C++

#include "bits/stdc++.h"

#pragma warning(disable:4996)
using namespace std;
using ld = long double;
ld eps=1e-9;
#define Seg_Max_N (1<<18) 

int ans=0;
int need;
int dfs(long long int num, int k,vector<int>&oks) {
	vector<int>v{ 3,5,7 };
	if(num<=need&&oks[0]&&oks[1]&&oks[2])ans++;
	if(num>=1e9)return 0;
	for (int i = 0; i < 3; ++i) {
		oks[i]++;
		dfs(num*10+v[i],k,oks);
		oks[i]--;
	}
	return 0;
}


vector<int>primes;
void hurui(const int amax) {
	static bool flag = false;
	if (flag)return;
	vector<int>sos;
	sos = vector<int>(amax + 1, true);
	sos[0] = false; sos[1] = false;
	for (int i = 2; i <= amax; ++i) {
		if (sos[i]) {
			for (int j = 2 * i; j <= amax; j += i)sos[j] = false;
		}
	}
	for (int i = 0; i <= amax; ++i) {
		if (sos[i]) {
			primes.push_back(i);
		}
	}
	flag = true;
}
map<long long int, int>soinnsuu(long long int a) {
	hurui(1000);
	map<long long int, int>ans;
	for (auto i : primes) {
		if (i> a)break;
		while (a%i == 0) {
			ans[i]++;
			a /= i;
		}
	}
	if (a != 1)ans[a]++;
	return ans;
}
int main() {

	int N;cin>>N;
	map<int,int>mp;
	for (int i = 1; i <= N; ++i) {
		auto m=soinnsuu(i);
		if (auto a:m) {
			mp[a.first]+=a.second;
		}
	}
	vector<vector<long long int>>dp(mp.size()+1,vector<long long int>(76));
	int x=0;
	dp[0][1]=1;
	for (auto m : mp) {
		for (int i = 0; i <= 75; ++i) {
			for (int j = 1; j <= 75; ++j) {
				if (j - 1 >= m.second) {
					int k=i*j;
					if(k<=75)dp[x+1][k]+=dp[x][i];
				}
			}
		}
	}
	cout<<dp[mp.size()][75]<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:62:27: error: found ':' in nested-name-specifier, expected '::'
   62 |                 if (auto a:m) {
      |                           ^
      |                           ::
a.cc:62:26: error: 'a' has not been declared
   62 |                 if (auto a:m) {
      |                          ^
a.cc:62:29: error: qualified-id in declaration before ')' token
   62 |                 if (auto a:m) {
      |                             ^
a.cc:63:28: error: 'a' was not declared in this scope
   63 |                         mp[a.first]+=a.second;
      |                            ^
Language: C++

from collections import defaultdict
from itertools import combinations

def factorize(n, fct):
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct[b] += e
        b, e = b + 1, 0
    if n > 1:
        fct[n] += 1
    return fct


N = int(input())
d = defaultdict(lambda: 0)
for i in range(N+1):
    d = factorize(i, d)


keys = list(d.keys())

certificates = []

for k in keys:
    if d[k] >= 2:
        certificates.append(k)


res = 0
        
for i,j,k in combinations(certificates, 3):
    if d[j] >= 4 and d[k] >= 4:
        res += 1
    if d[i] >= 4 and d[k] >= 4:
        res += 1
    if d[i] >= 4 and d[j] >= 4:
        res += 1

for i,j in combinations(certificates, 2):
    if d[i] >= 24:
        res += 1
    if d[j] >= 24:
        res += 1
        
for i,j in combinations(certificates, 2):
    if d[i] >= 4 and d[j] >= 14:
        res += 1
    if d[j] >= 4 and d[i] >= 14:
        res += 1
    
for i in certificates:
    if d[i] >= 74:
        res += 1

print(res)



Compiler output:
a.cc:5:18: error: stray '#' in program
    5 |     b, e = 2, 0  # base, exponent
      |                  ^
a.cc:1:1: error: 'from' does not name a type
    1 | from collections import defaultdict
      | ^~~~
Language: C++

import math

def is_prime(n):
    if n==1:
        return False
    for i in range(n-2):
        if n % (i+2) == 0:
            return False
    return True

prime_list = []
for i in range(100):
    if is_prime(i+1):
        prime_list.append(i+1)


factor_list = [0] * len(prime_list)

N = int(input())

for i in range(N):
    for p in prime_list:
        j = i+1
        while j % p == 0:
            factor_list[prime_list.index(p)] += 1
            j = j / p

ans = 0
for i in range(len(factor_list)):
    if factor_list[i] >= 74:
        ans += 1

cnta = 0
cntb = 0
for i in range(len(factor_list)):
    if factor_list[i] >= 14:
        cnta += 1
    if factor_list[i] >= 4:
        cntb += 1
ans += cnta * (cntb-1)

cnta = 0
cntb = 0
for i in range(len(factor_list)):
    if factor_list[i] >= 24:
        cnta += 1
    if factor_list[i] >= 2:
        cntb += 1
ans += cnta * (cntb-1)

cnta = 0
cntb = 0
for i in range(len(factor_list)):
    if factor_list[i] >= 4:
        cnta += 1
    if factor_list[i] >= 2:
        cntb += 1
ans += cnta * (cnta-1) * (cntb-2) /2

print(int(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<iostream>
#include<string>
#include<cstdlib>
#include<vector> 
using namespace std;
vector<int> ps={2,3,5,7,11,13,17,19,23,29,31,37,41
   ,43,47,53,59,61,67,71,73,79,83,89,97};
int pow(int base,int n){
    if(n==0)return 1;
    else return pow(n-1)*base;
}
int are(int p, int N){
    if(N==0)return 0;
    return N/p + are(p, N/p);
}
int nanko(vector<int> a, int limit){
    int sum = 0;
    for(auto aaa:a){
        if(aaa>=limit)sum+=1;
    }
    return sum;
}
int main(){
    int N;
    cin>>N;
    vector<int> a;
    
    for(auto p: ps){
        int aaa=are(p, N);
        a.push_back(aaa);
    }
    /////////////////
    int t24=nanko(a, 24);
    int t14=nanko(a, 14);
    int t4=nanko(a, 4);
    int t2=nanko(a, 2);
    int case1=t24*(t2-1);
    int case2=t14*(t4-1);
    int case3=t4*(t4-1)/2*(t2-2);
    cout<<case1+case2+case3<<endl;
}

Compiler output:
a.cc: In function 'int pow(int, int)':
a.cc:10:20: error: too few arguments to function 'int pow(int, int)'
   10 |     else return pow(n-1)*base;
      |                 ~~~^~~~~
a.cc:8:5: note: declared here
    8 | int pow(int base,int n){
      |     ^~~
Language: C

#include<stdio.h>

int main(void){
  
  int n,N = 1;
  int i,j,k,l;
  int count = 0,result = 0;
  
  scanf("%d",&n);
  
  for(i = 1;i < n;i++){
    N *= i;
  }
  
  for(j = 1;j <= N;j++){
    k = N % j;
    if(k == 0){
      count = 0;
      for(l = 1;l <= k;l++){
        if(K % l == 0){
         count++; 
        }
      }
      if(count == 75){
       result++; 
      }
    }
  }
      
  printf("%d",result);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:20:12: error: 'K' undeclared (first use in this function)
   20 |         if(K % l == 0){
      |            ^
main.c:20:12: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

int main(void){
  
  int n,N = 1;
  int i,j,k,l;
  int count = 0,result = 0;
  
  scanf("%d",&n);
  
  for(i = 1;i < n;i++){
    N *= i
  }
  
  for(j = 0;j < N;j++){
    k = N % j;
    if(k == 0){
      for(l = 0;l < k;l++){
        if(k % l == 0){
         count++; 
        }
      }
      if(count == 75){
       result++; 
      }
    }
  }
      
  printf("%d",result);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:11: error: expected ';' before '}' token
   12 |     N *= i
      |           ^
      |           ;
   13 |   }
      |   ~
Language: C++

#include<iostream>
int main(){
cout<<0;return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    3 | cout<<0;return 0;
      | ^~~~
      | std::cout
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

p=1;
n=gets.to_i;
n.times{|i|p*=i+1}
d=[0]*1e5;
d[1]=1;
(2..n).map{|i|
	c=0;
	(p/=i;c+=1)while p%i<1;
	(1..75).map{|k|c.times{|j|d[(76-k).*j+2]+=d[76-k]}}
}
p d[75]

Compiler output:
a.cc:6:2: error: too many decimal points in number
    6 | (2..n).map{|i|
      |  ^~~~
a.cc:9:10: error: too many decimal points in number
    9 |         (1..75).map{|k|c.times{|j|d[(76-k).*j+2]+=d[76-k]}}
      |          ^~~~~
a.cc:1:1: error: 'p' does not name a type
    1 | p=1;
      | ^
a.cc:2:1: error: 'n' does not name a type
    2 | n=gets.to_i;
      | ^
a.cc:3:1: error: 'n' does not name a type
    3 | n.times{|i|p*=i+1}
      | ^
a.cc:4:1: error: 'd' does not name a type
    4 | d=[0]*1e5;
      | ^
a.cc:5:1: error: 'd' does not name a type
    5 | d[1]=1;
      | ^
a.cc:6:2: error: expected unqualified-id before numeric constant
    6 | (2..n).map{|i|
      |  ^~~~
a.cc:6:2: error: expected ')' before numeric constant
    6 | (2..n).map{|i|
      | ~^~~~
      |  )
a.cc:11:1: error: 'p' does not name a type
   11 | p d[75]
      | ^
Language: C

#include<stdio.h>

int main(void){
  
  int n;
  int i,j,k,l;
  int nanago,result;
  
  scanf("%d",&n);
  
  for(i = 1;i < n;i++){
    n *= i;
  }
  
  for(j = 0;j < n;j++){
    k = n % j;
    if(k == 0){
      for(l = 0;l < k;l++){
        if(k % l == 0){
         count++; 
        }
      }
      if(count == 75){
       result++; 
      }
    }
  }
      
  printf("%d",result);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:20:10: error: 'count' undeclared (first use in this function)
   20 |          count++;
      |          ^~~~~
main.c:20:10: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <bit/stdc++.h>
using namespace std;
using ll = long long;

const int MAX_N = 110;
int n, a[MAX_N];

void solve()
{
	int tot = 0;
	for(int i=0;i<n;++i) tot+=a[i];
	int ans = 0;
	for(int i=1;i<n;++i)if(abs(n*a[i]-tot)<abs(n*a[ans]-tot))ans=i;
	cout<<ans;
}

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

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

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

int main() {
  int n;
  vector<int> a(n);
  double sum=0;
  for ( int i=0; i<n; i++ ) cin >> a[i];
  for ( int i=0; i<n; i++ ) sum += a[i];
  sum/=n;
  int id=0, dist=100;
  for ( int i=0; i<n; i++ ) if ( fabs(sum-a[i])<dist ) { id=i; dist=fabs(sum-a[i]); }
  cout << id << '\n';
  return 0;
}

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

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

int main(){
    double N;
    cin >> N;
    vector<double>a(N);
    double wa = 0;
    for(int i = 0; i < N; i++) {
        cin >> a[i];
        wa+=a[i];
    }
    wa /=N;
    double a = 777;
    for(int i = 0; i < N; i++) {
        a = min(a,abs(goukei-a[i]));
    }
    for(int i = 0; i < N; i++) {
        if(abs(goukei-a[i]) == sa) {
            cout << i << endl;
            return 0;
        }
    }
} 


Compiler output:
a.cc: In function 'int main()':
a.cc:14:12: error: conflicting declaration 'double a'
   14 |     double a = 777;
      |            ^
a.cc:7:19: note: previous declaration as 'std::vector<double> a'
    7 |     vector<double>a(N);
      |                   ^
a.cc:16:23: error: 'goukei' was not declared in this scope
   16 |         a = min(a,abs(goukei-a[i]));
      |                       ^~~~~~
a.cc:19:16: error: 'goukei' was not declared in this scope
   19 |         if(abs(goukei-a[i]) == sa) {
      |                ^~~~~~
a.cc:19:32: error: 'sa' was not declared in this scope; did you mean 'wa'?
   19 |         if(abs(goukei-a[i]) == sa) {
      |                                ^~
      |                                wa
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for (int i = 1; i < (int)(n); i++)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define debug(var) do{cout << #var << " : "; view(var);}while(0)
template<class T> bool chmin(T &a, T b) {if(a>b) {a=b;return 1;}return 0;}
template<class T> bool chmax(T &a, T b) {if(a<b) {a=b;return 1;}return 0;}
using namespace std;
template<class T> void view(T e) {cout << e << endl;}
template<class T> void view(const vector<T> &v) {for(const auto &e : v){cout << e << " ";} cout << endl;}
template<class T> void view(const vector<vector<T>> &vv) {for(const auto &v : vv){view(v);}}
using vint = vector<int>;
using vvint = vector<vector<int>>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<int,int>;
const int inf = 1e9;
const ll inf_l = 1e18;
const int MAX = 1e5;

int main() {
    int n; cin >> n;
    vint a(n);
    double mean = 0;
    rep(i,n) {
        int x; cin >> x;
        mean += x;
        a[i] = x;
    }
    mean /= n;
    double mn = 100000;
    int ans;
    for (int i = n-1; i >= 0; i--) {
        if (chmin(inf,abs(mean-a[i]))) ans = i;
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:18: error: no matching function for call to 'chmin(const int&, double)'
   36 |         if (chmin(inf,abs(mean-a[i]))) ans = i;
      |             ~~~~~^~~~~~~~~~~~~~~~~~~~
a.cc:7:24: note: candidate: 'template<class T> bool chmin(T&, T)'
    7 | template<class T> bool chmin(T &a, T b) {if(a>b) {a=b;return 1;}return 0;}
      |                        ^~~~~
a.cc:7:24: note:   template argument deduction/substitution failed:
a.cc:36:18: note:   deduced conflicting types for parameter 'T' ('const int' and 'double')
   36 |         if (chmin(inf,abs(mean-a[i]))) ans = i;
      |             ~~~~~^~~~~~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for (int i = 1; i < (int)(n); i++)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define debug(var) do{cout << #var << " : "; view(var);}while(0)
template<class T> bool chmin(T &a, T b) {if(a>b) {a=b;return 1;}return 0;}
template<class T> bool chmax(T &a, T b) {if(a<b) {a=b;return 1;}return 0;}
using namespace std;
template<class T> void view(T e) {cout << e << endl;}
template<class T> void view(const vector<T> &v) {for(const auto &e : v){cout << e << " ";} cout << endl;}
template<class T> void view(const vector<vector<T>> &vv) {for(const auto &v : vv){view(v);}}
using vint = vector<int>;
using vvint = vector<vector<int>>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<int,int>;
const int inf = 1e9;
const ll inf_l = 1e18;
const int MAX = 1e5;

int main() {
    int n; cin >> n;
    vint a(n);
    double mean = 0;
    rep(i,n) {
        int x; cin >> x;
        mean += x;
        a[i] = x;
    }
    mean /= n;
    double mn = inf;
    int ans;
    for (int i = n-1; i >= 0; i--) {
        if (chmin(inf,abs(mean-a[i]))) ans = i;
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:18: error: no matching function for call to 'chmin(const int&, double)'
   36 |         if (chmin(inf,abs(mean-a[i]))) ans = i;
      |             ~~~~~^~~~~~~~~~~~~~~~~~~~
a.cc:7:24: note: candidate: 'template<class T> bool chmin(T&, T)'
    7 | template<class T> bool chmin(T &a, T b) {if(a>b) {a=b;return 1;}return 0;}
      |                        ^~~~~
a.cc:7:24: note:   template argument deduction/substitution failed:
a.cc:36:18: note:   deduced conflicting types for parameter 'T' ('const int' and 'double')
   36 |         if (chmin(inf,abs(mean-a[i]))) ans = i;
      |             ~~~~~^~~~~~~~~~~~~~~~~~~~
Language: Java

import java.util.*;

public class Main {
	public static void main(String[] args) throws Exception{
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();
		int[] a = new int[n];
		for(int i=0; i<a.length; ++i){
			a[i] = scn.nextInt();
		}
      	double sum = 0;
      	for(int i=0; i<a.length; ++i){
			sum = sum + a[i];
		}
      	double ave = sum/n;
        double dif = ave;
      	double xxx = 0;
      	int ans = 0;
      	for(int i=0; i<a.length; ++i){
			xxx = Math.abs(ave-a[i]);
          	if(dif>xxx){
              dif=xxx;
              int ans = i;
            }
		}
      System.out.println(ans);
	}
}

Compiler output:
Main.java:23: error: variable ans is already defined in method main(String[])
              int ans = i;
                  ^
1 error
Language: Java

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int a[] = new int[N];
        int total = 0;
        double distance[] = new double[N];
        for(int i = 0; i < N; i++){
            a[i] = sc.nextInt();
            total += a[i];
        }
        double ave = (double)(total / N);
        for(int i = 0; i < N; i++){
            distance[i] = ave - a[i];
        }
        System.out.println(Math.min(distance[]));
        
    }
}


Compiler output:
Main.java:19: error: '.class' expected
        System.out.println(Math.min(distance[]));
                                              ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n; cin >> n;
  vector<double>v(n);
  for(auto&e:v)cin >> e;
  double ave=0;
  for(auto&e:v)ave+=e;
  ave = ave / n;
  int argi = 0;
  for(int i = 0; i < n; ++i){
    if(abs(v[i]-ave) < abs(v[argi]-ave))i = argi;
  }
  cout << i << endl;
}

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

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define ins insert
#define all(x) (x).begin(),(x).end()
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[8]={1,0,-1,0,1,1,-1,-1};
const ll dx[8]={0,-1,0,1,1,-1,1,-1};
using Graph = vector<vector<int>>;
const ll mod=1000000007;
const int MAX_N = 1000;         // n の最大値
 
double nCk(int n, int k) {
double res=1.0;
for(int i=0; i<n; i++){
res*=0.5;}
for(int i=0; i<k; i++){
res*=(double)(n-i);
res/=(double)(k-i);
}
return res;}
 
int main() {
ll n; cin >>n;
ll a[n]={};
double ca=0;
for(ll i=0; i<n; i++){
cin>>a[i];
ca+=a[i];}
ca = ca/(double)n;
ll ans=0;
ll k=abs(ca-a[0]);
rep(i,n){
if(k>abs(ca-a[i]){
ans=i,k=abs(ca-a[i]);}}
cout << ans << endl;}


Compiler output:
a.cc: In function 'int main()':
a.cc:46:18: error: expected ')' before '{' token
   46 | if(k>abs(ca-a[i]){
      |   ~              ^
      |                  )
a.cc:47:23: error: expected primary-expression before '}' token
   47 | ans=i,k=abs(ca-a[i]);}}
      |                       ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define ins insert
#define all(x) (x).begin(),(x).end()
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[8]={1,0,-1,0,1,1,-1,-1};
const ll dx[8]={0,-1,0,1,1,-1,1,-1};
using Graph = vector<vector<int>>;
const ll mod=1000000007;
const int MAX_N = 1000;         // n の最大値
 
double nCk(int n, int k) {
double res=1.0;
for(int i=0; i<n; i++){
res*=0.5;}
for(int i=0; i<k; i++){
res*=(double)(n-i);
res/=(double)(k-i);
}
return res;}
 
int main() {
ll n; cin >>n;
ll a[n]={};
double ca=0;
for(ll i=0; i<n; i++){
cin>>a[i];
ca+=a[i];}
ca = ca/(double)n;
ll ans=0;
ll k=abs(ca-a[0]);
rep(i,n){
if(k>abs(ca-a[i])
ans=i,k=abs(ca-a[i]);}
cout << ans << endl;}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:18: error: expected ';' before 'ans'
   46 | if(k>abs(ca-a[i])
      |                  ^
      |                  ;
   47 | ans=i,k=abs(ca-a[i]);}
      | ~~~               
a.cc:47:22: error: expected primary-expression before '}' token
   47 | ans=i,k=abs(ca-a[i]);}
      |                      ^
a.cc:47:22: error: expected ')' before '}' token
   47 | ans=i,k=abs(ca-a[i]);}
      |                      ^
      |                      )
a.cc:46:3: note: to match this '('
   46 | if(k>abs(ca-a[i])
      |   ^
a.cc:47:22: error: expected primary-expression before '}' token
   47 | ans=i,k=abs(ca-a[i]);}
      |                      ^
Language: C++

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

int main(){
    
    double N;
    cin >> N;
    double a[N];
    double sum = 0;
    for(int i = 0; i < N;i++)cin >> a[i],sum += a[i];
    
    double ave = sum/N;
    
    double mn = INT_MAX;
    double ans = 0;
    for(int i = 0; i < N-1;i++){
        
        if(mn >abs(a[i]-ave)){
            mn = abs(a[i]-ave);
            ans = i;
        }
        
    }
    cout << ans <<endl;
}
    
    



Compiler output:
a.cc: In function 'int main()':
a.cc:9:14: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
    9 |     double a[N];
      |              ^
a.cc:9:14: error: could not convert 'N' from 'double' to 'long unsigned int'
    9 |     double a[N];
      |              ^
      |              |
      |              double
a.cc:9:14: error: size of array 'a' has non-integral type 'double'
Language: C++

#include <iostream>
#include <string>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
using namespace std;

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

int main(){
    int N;
    cin >> N;
    int a[N];
    int  sum = 0;
    rep(i, N){
        cin >> a[i];
        sum += a[i];
    }
    int res = sum * sum; //各値から平均を引いた値で最小となるもの
    rep(i, N){
        int sub = fabs(N * a[i] - sum);
        res = min(res, sub);
    }
    rep(i, N){
        if(res == abs(N * a[i] - sum))){
            cout << i << endl;
            break;
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:39: error: expected primary-expression before ')' token
   28 |         if(res == abs(N * a[i] - sum))){
      |                                       ^
Language: C++

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

const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define ALL(v) (v.begin(),v.end())
#define COUT(x) cout<<(x)<<endl

int main(){
    int n;
    cin >> n;
    int a[n];
    REP(i,n){
        cin >> a[i];
        ans += a[i];
    }
    int min1 = INF,index=0;
    REP(i,n){
        if(min1>abs(a[i]*n-ans)){
            min1 = abs(a[i]*n-ans);
            index = i;
        }
    }
    COUT(index);
    return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:21:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   21 |         ans += a[i];
      |         ^~~
      |         abs
a.cc:25:28: error: 'ans' was not declared in this scope; did you mean 'abs'?
   25 |         if(min1>abs(a[i]*n-ans)){
      |                            ^~~
      |                            abs