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

#include <iostream>
#include <string>
using namespace std;
int main(){

int a,b[100],c,min;
min=0;
c=0;
cin>>a;
	for(int i=0;i<a;i++){
		cin>>a[i];
		c=c+a[i]
	}
	if(c%10>0){
		cout<<c<<endl;
	}
	for(int j=0;j<2;j++){
		for(int k=0;k>a;k++){
			if(min>a[k] && a[k]%10>0){
				min=a[k];
			}
		}
	}
	if(min==0){
	cout<<0<<endl;
	}
	cout<<c-min<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:23: error: invalid types 'int[int]' for array subscript
   11 |                 cin>>a[i];
      |                       ^
a.cc:12:22: error: invalid types 'int[int]' for array subscript
   12 |                 c=c+a[i]
      |                      ^
a.cc:19:33: error: invalid types 'int[int]' for array subscript
   19 |                         if(min>a[k] && a[k]%10>0){
      |                                 ^
a.cc:19:41: error: invalid types 'int[int]' for array subscript
   19 |                         if(min>a[k] && a[k]%10>0){
      |                                         ^
a.cc:20:38: error: invalid types 'int[int]' for array subscript
   20 |                                 min=a[k];
      |                                      ^
Language: C

#include<stdio.h>
int main(){
int n,m,i,j,N,s[100];
j=0;
scanf("%d",&N);
for(n=0;n<N;n++){
scanf("%d",&s[n]);
}
for(m=0;m<N;m++){
i=s[m]%10;
j=j+i;
}
k=j%10;
if(k!=0){
printf("%d\n",j);
}

Compiler output:
main.c: In function 'main':
main.c:13:1: error: 'k' undeclared (first use in this function)
   13 | k=j%10;
      | ^
main.c:13:1: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:1: error: expected declaration or statement at end of input
   16 | }
      | ^
Language: C++

#include<iostream>
using namespace std;


int main(){
  int n;
  cin >> n;
  
  int s[n];

  for(int i=0; i<n; i++) cin >> s[i];

  int sum = 0;
  for(int i=0; i<n; i++) sum += s[i];

  sort(s,s+n);

  if(sum % 10 != 0){
    cout << sum << endl;
    return 0;
  }

  for(int i=0; i<n; i++){
    if(s[i] % 10 != 0){
      sum -=s[i];
      cout << sum << endl;
      return 0;
    }
  }

  cout << 0 << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   16 |   sort(s,s+n);
      |   ^~~~
      |   short
Language: Java

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

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();

		int[] marks = new int[n];
		int sum = 0;

		for(int i=0; i<n; i++){
			marks[i] = sc.nextInt();
			sum += marks[i];
		}

		Arrays.sort(marks);
		int k = 0;

		while(sum%10 == 0 && sum != 0){
			while(k<marks.length && marks[k]%10 ==0s) k++;
			if(k == marks.length){
				sum = 0;
				break;
			}
			sum -= marks[k++];
		}

		System.out.println(sum);
	}
}


Compiler output:
Main.java:21: error: ')' expected
			while(k<marks.length && marks[k]%10 ==0s) k++;
			                                       ^
Main.java:21: error: ';' expected
			while(k<marks.length && marks[k]%10 ==0s) k++;
			                                        ^
2 errors
Language: C++


#include <iostream>
#include <math.h>
using namespace std;
int main(int argc, const char * argv[]) {
    short N;
    cin >> N;
    short* scores = new short[N];
    
    for (int i = 0; i < N; i++) {
        cin >> scores[i];
    }
    
    sort(scores, scores + N);
    
    long total = 0;
    
    for (int i = 0; i < N; i++) {
        total += scores[i];
    }
    
    if (total % 10 != 0) {
        cout << total << endl;
        delete[] scores;
        return 0;
    }
    
    for (int i = 0; i < N; i++) {
        if (scores[i] % 10 != 0){
            cout << total - scores[i] << endl;
            delete[] scores;
            return 0;
        }
    }
    
    delete[] scores;
    cout << 0 << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:14:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   14 |     sort(scores, scores + N);
      |     ^~~~
      |     sqrt
Language: C++

#include<iostream>

using namespace std;

int main(void) {

	int n, s[100],tmp,j,S=0,MAX[100],ans;

	cin >> n;

	for (int i = 0; i < n; i++) {

		cin >> s[i];

	}

	for (j = 0; j < n; j++) {

		for (int i = 0; i < n; i++) {

			if (s[j] < s[i]) {

				tmp = s[i];
				s[i] = s[j];
				s[j] = tmp;

			}
		}
	}

	for (int i = 0; i < n; i++) {

		S = S + s[i];

	}

	if (S % 10 != 0)
		cout << S << endl;

	else if (S % 10 == 0) {

		for (int i = 0; i < n; i++) {

			MAX[i] = S - s[i];

			if (MAX[i] % 10 != 0) {
				ans = MAX[i];
				break;
			}
		}

		cout << ans << endl;

	}


Compiler output:
a.cc: In function 'int main()':
a.cc:54:10: error: expected '}' at end of input
   54 |         }
      |          ^
a.cc:5:16: note: to match this '{'
    5 | int main(void) {
      |                ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <functional>
#include <numeric>
#include <limit>

int main( void ) {
    int n;
    std::cin >> n;

    std::vector< int > ss;

    for( size_t i = 0; i < n; ++i ) {
        int s;
        std::cin >> s;
        ss.push_back( s );
    }

    // 結局全てを足したとして、2つのケースしか生じない
    // A: 全合計値は10の倍数ではなかった
    //   このときはそのまま採用すればよい
    // B: 全合計値は10の倍数であった
    //   このときは、一番小さい10の倍数ではない数を引けば10の倍数ではなくなる

    const int sum = std::accumulate( ss.begin(), ss.end(), 0 );

    int min = std::numelic_limits<int>::max();  // 番兵
    for( size_t i = 0; i < ss.size(); ++i ) {
        if( ss[ i ] % 10 == 0 ) continue;
        min = std::min( min, ss[ i ] );
    }

    if( sum % 10 == 0 ) {
        std::cout << sum - min << std::endl;
    } else {
        std::cout << sum << std::endl;
    }

    return 0;
}

Compiler output:
a.cc:7:10: fatal error: limit: No such file or directory
    7 | #include <limit>
      |          ^~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <functional>
#include <numeric>
#include <limits>

int main( void ) {
    int n;
    std::cin >> n;

    std::vector< int > ss;

    for( size_t i = 0; i < n; ++i ) {
        int s;
        std::cin >> s;
        ss.push_back( s );
    }

    // 結局全てを足したとして、2つのケースしか生じない
    // A: 全合計値は10の倍数ではなかった
    //   このときはそのまま採用すればよい
    // B: 全合計値は10の倍数であった
    //   このときは、一番小さい10の倍数ではない数を引けば10の倍数ではなくなる

    const int sum = std::accumulate( ss.begin(), ss.end(), 0 );

    int min = std::numelic_limits<int>::max();  // 番兵
    for( size_t i = 0; i < ss.size(); ++i ) {
        if( ss[ i ] % 10 == 0 ) continue;
        min = std::min( min, ss[ i ] );
    }

    if( sum % 10 == 0 ) {
        std::cout << sum - min << std::endl;
    } else {
        std::cout << sum << std::endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:20: error: 'numelic_limits' is not a member of 'std'; did you mean 'numeric_limits'?
   29 |     int min = std::numelic_limits<int>::max();  // 番兵
      |                    ^~~~~~~~~~~~~~
      |                    numeric_limits
a.cc:29:35: error: expected primary-expression before 'int'
   29 |     int min = std::numelic_limits<int>::max();  // 番兵
      |                                   ^~~
Language: C++

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

int main( void ) {
    int n;
    std::cin >> n;

    std::vector< int > ss;

    for( size_t i = 0; i < n; ++i ) {
        int s;
        std::cin >> s;
        ss.push_back( s );
    }

    // 結局全てを足したとして、2つのケースしか生じない
    // A: 全合計値は10の倍数ではなかった
    //   このときはそのまま採用すればよい
    // B: 全合計値は10の倍数であった
    //   このときは、一番小さい10の倍数ではない数を引けば10の倍数ではなくなる

    const int sum = std::accumulate( ss.begin(), ss.end(), 0 );

    int min = std::numelic_limits<int>::max();  // 番兵
    for( size_t i = 0; i < ss.size(); ++i ) {
        if( ss[ i ] % 10 == 0 ) continue;
        min = std::min( min, ss[ i ] );
    }

    if( sum % 10 == 0 ) {
        std::cout << sum - min << std::endl;
    } else {
        std::cout << sum << std::endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:26: error: 'accumulate' is not a member of 'std'
   25 |     const int sum = std::accumulate( ss.begin(), ss.end(), 0 );
      |                          ^~~~~~~~~~
a.cc:27:20: error: 'numelic_limits' is not a member of 'std'
   27 |     int min = std::numelic_limits<int>::max();  // 番兵
      |                    ^~~~~~~~~~~~~~
a.cc:27:35: error: expected primary-expression before 'int'
   27 |     int min = std::numelic_limits<int>::max();  // 番兵
      |                                   ^~~
Language: C++

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

int main( void ) {
    int n;
    std::cin >> n;

    std::vector< int > ss;

    for( size_t i = 0; i < n; ++i ) {
        int s;
        std::cin >> s;
        ss.push_back( s );
    }

    // 結局全てを足したとして、2つのケースしか生じない
    // A: 全合計値は10の倍数ではなかった
    //   このときはそのまま採用すればよい
    // B: 全合計値は10の倍数であった
    //   このときは、一番小さい10の倍数ではない数を引けば10の倍数ではなくなる

    const int sum = std::accumulate( ss.begin(), ss.end(), 0 );

    int min = std::numelic_limits<int>::max();  // 番兵
    for( size_t i = 0; i < ss.size(); ++i ) {
        if( ss[ i ] % 10 == 0 ) continue;
        min = std::min( min, ss[ i ] );
    }

    if( sum % 10 == 0 ) {
        std::cout << sum - min << std::endl;
    } else {
        std::cout << sum << std::endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:26: error: 'accumulate' is not a member of 'std'
   24 |     const int sum = std::accumulate( ss.begin(), ss.end(), 0 );
      |                          ^~~~~~~~~~
a.cc:26:20: error: 'numelic_limits' is not a member of 'std'
   26 |     int min = std::numelic_limits<int>::max();  // 番兵
      |                    ^~~~~~~~~~~~~~
a.cc:26:35: error: expected primary-expression before 'int'
   26 |     int min = std::numelic_limits<int>::max();  // 番兵
      |                                   ^~~
Language: C++

include<iostream>
using namespace std;
int main(){
        int N,a;
        int min, sum;
        min = -1;
        cin>>N;
        sum = 0;
        for(int i=0;i<N;i++){
                cin>>a;
                sum += a;
                if(a%10==0){
                        continue;
                }
                if(min>a||min==-1){
                        min = a;
                }
        }
        if(sum%10==0&&min!=-1){
                sum -= min;
        }
        if(sum%10==0){
                sum = 0;
        }
        printf("%d\n",sum);
        //cout<<sum<<endl;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope; did you mean 'min'?
    7 |         cin>>N;
      |         ^~~
      |         min
a.cc:25:9: error: 'printf' was not declared in this scope
   25 |         printf("%d\n",sum);
      |         ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | include<iostream>
Language: C

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

int main() {
	int n;
	int sum=0;
	cin>>n;
	int a[n];
	for(int i=0;i<n;i++){cin>>a[i];sum+=a[i];}
	if(sum%10!=0){cout<<sum<<endl;return 0;}
	sort(a,a+n);
	for(int i=0;i<n;i++){
	    sum-=a[i];
	    if(sum%10!=0){
	        cout<<sum<<endl;
	        return 0;
	    }
	    sum+=a[i];
	}
	cout<<"0"<<endl;
	return 0;
}


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

#include <iostream>
using namespace std;
int map[10001][101];
map[0][0]++;
int main(){
int N;
cin >>N;
int s;
for(int i=0;i<N;i++){
cin>>s;
for(int j=0;j<10001;j++){
map[j][i+1]=map[j][i];
if(j+s<10001)map[j+s][i+1]=map[j][i];
}}
int m=0;
for(int i=10000; i>=0;i--){
if(i%10==0)continue;
if(map[i][N]==1){
m=i;
}}
cout << m<< endl;
return 0;}


Compiler output:
a.cc:4:1: error: 'map' does not name a type
    4 | map[0][0]++;
      | ^~~
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <limits.h>	
#define inf INT_MAX
#define INF 9223372036854775807
#define rep(i,n) for(i=0;i<n;i++)

int in(void){
	int i;scanf("%d",&i);
	return i;
}
long long llin(void){
	long long i;scanf("%lld",&i);
	return i;
}
void chin(char s[]){
	scanf("%s",s);
}
void print(int a){
	printf("%d\n",a);
}
void llprint(long long a){
	printf("%lld\n",a);
}
void print2(int a,int b){
	printf("%d %d\n",a,b);
}
long long max(long long a,long long b){
	return a>b?a:b;
}
long long min(long long a,long long b){
	return a<b?a:b;
}

int main(void){
	int n=in(),i,s[100],sum=0,m=0;
	rep(i,n){
		s[i]=in();
		sum+=s[i];
	}
	if(s%10!=0){
		print(s);
		return 0;
	}
	rep(i,n){
		if((sum-s[i])%10!=0){
			m=max(m,sum-s[i]);
		}
	}
	print(m);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:43:13: error: invalid operands to binary % (have 'int *' and 'int')
   43 |         if(s%10!=0){
      |            ~^
      |            |
      |            int *
main.c:44:23: error: passing argument 1 of 'print' makes integer from pointer without a cast [-Wint-conversion]
   44 |                 print(s);
      |                       ^
      |                       |
      |                       int *
main.c:21:16: note: expected 'int' but argument is of type 'int *'
   21 | void print(int a){
      |            ~~~~^
Language: C++

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

using namespace std;

int main(){
    cin.tie(0);
   	ios::sync_with_stdio(false);
    int N;
    cin >> N;
    vector<int> v(N), noten;
    for (int i = 0; i < N; ++i){
        cin >> v[i];
        if (v[i] % 10 != 0) noten.push_back(v[i])
    }

    sort(noten.begin(), noten.end());
    int sum = accumulate(v.begin(), v.end(), 0);

    if (sum % 10 != 0) cout << sum << endl;
    else cout << sum - noten[0] << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:50: error: expected ';' before '}' token
   16 |         if (v[i] % 10 != 0) noten.push_back(v[i])
      |                                                  ^
      |                                                  ;
   17 |     }
      |     ~
Language: C++

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

using namespace std;

int main(){
    cin.tie(0);
   	ios::sync_with_stdio(false);
    int N;
    cin >> N;
    vector<int> v(N), noten;
    for (int i = 0; i < N; ++i){
        cin >> v[i];
    }

    for (int i = 0; i< N; ++i){
        if (v[i] % 10 != 0) noten[i] = v[i]
    }

    sort(noten.begin(), noten.end());
    int sum = accumulate(v.begin(), v.end(), 0);

    if (sum % 10 != 0) cout << sum << endl;
    else cout << sum - noten[0] << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:44: error: expected ';' before '}' token
   19 |         if (v[i] % 10 != 0) noten[i] = v[i]
      |                                            ^
      |                                            ;
   20 |     }
      |     ~
Language: C++

#include <iostream>
#include <vector>
#include <numeric>

using namespace std;

int main(){
    int N;
    cin >> N;
    vector<int> v(N), noten;
    for (int i = 0; i < N; ++i){
        cin >> v[i];
        if (v[i] % 10 != 10) noten[i] = v[i];
    }

    sort(noten.begin(), noten.end());
    int sum = accumulate(v.begin(), v.end(), 0);

    if (sum % 10 != 0) cout << sum << endl;
    else cout << sum - noten[0] << endl;

    return 0;
}


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

#include <iostream>
#include <vector>
#include <numeric>

using namespace std;

int main(){
    int N;
    cin >> N;
    std::vector<int> v(N), noten(N);
    for (int i = 0; i < N; ++i){
        cin >> v[i];
        if (v[i] % 10 != 10) noten[i] = v[i];
    }

    sort(noten.begin(), noten.end());
    int sum = accumulate(v.begin(), v.end(), 0);

    if (sum % 10 != 0) cout << sum << endl;
    else cout << sum - noten[0] << endl;

    return 0;
}

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

#include <iostream>
using namespace std;
int main()
{
    int N;
    cin >> N;
    int S[N-1];
    for (int i = 0;i < N;i++){
      cin >> S[i];
    }
    sort(S, S + N);
    int t = 0;
    for(int c = 0;c < N;c++){
      t = t + S[c];
    }
    if(t%10!=0)
      cout << t <<"\n";
    else
      for(int d = 0;d < N;d++){
        if(d%10!=0)
          t = t-S[d];
          cout << t <<"\n";
          break;
      }
    if(t%10==0)
      cout << "0";
    return 0;
}

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

#include <iostream.h>
int main(int argc, char *argv[])
{
	int n;
	int s[101];
	scanf("%d",&n);
	int i,j,count=0;
	for(i=0;i<n;i++)
	{
		scanf("%d",&s[i]);
		count+=s[i];
	}
	for( j=0;j<n;j++)
	{
		if(count%10==0)
		{
			count-=s[j];
			if(count==0){
				printf("%d",count);
			}
		}
		else
	    {
			printf("%d",count);
			break;
		}
	}
	
	return 0;
}

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

#include <iostream.h>
int main(int argc, char *argv[])
{
	int n;
	int s[101];
	scanf("%d",&n);
	int i,j,count=0;
	for(i=0;i<n;i++)
	{
		scanf("%d",&s[i]);
		count+=s[i];
	}
	for( j=0;j<n;j++)
	{
		if(count%10==0)
		{
			count-=s[j];
			if(count==0){
				printf("%d",count);
			}
		}
		else
	    {
			printf("%d",count);
			break;
		}
	}
	
	return 0;
}

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

#include<bits/stdc++.h>

using namespace std;
int a[1000];
int sum;
int dp[1000];
int ans[1000];
int main()
{
    int n;
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
        {
            scanf("%d",&a[i]);
            sum+=a[i];
        }
    sort(a+1,a+1+n);
    if(sum[i]%10!=0)
        {
            printf("%d",sum);
            return 0;
        }
    for(int i=1;i<=n;i++)
    {
        if(a[i]%10!=0)
        {
            printf("%d",sum-a[i]);
            return 0;
        }
    }
    printf("0");
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:12: error: 'i' was not declared in this scope
   18 |     if(sum[i]%10!=0)
      |            ^
Language: C++

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

int main(void) {
	int N,i,A=0,b=0,j,c=0;
	scnaf("%d",N);
	int s[N];
	for(i=1;i<=N;i++){
		scanf("%d",&s[i-1]);
	}
	for(i=1;i<=N;i++){
		A+=s[i-1];
	}

	for(j=1;j<=N;j++){
		for(i=1;i<=N;i++){
			if(s[i-1]>=s[i]){
				b=s[i-1];
				s[i-1]=s[i];
				s[i]=b;
			}
		}
	}
	if(A%10 != 0){
		printf("%d",A);
	}
	else{
		for(i=1;i<=N;i++){
			if((A-s[i-1])%10!=0){
				printf("%d",A-s[i-1]);
				c=1;
				break;
			}
		}
	}
	if(c==0){
		printf("0");
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'scnaf' was not declared in this scope; did you mean 'scanf'?
    6 |         scnaf("%d",N);
      |         ^~~~~
      |         scanf
Language: C

#include <stdio.h>
int main(void){
int n;
int a[100];
int i;
int max=0;
int min=101;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&a[i]);
if((a[i]%10)!=0)&&(min >a[i])){
min =a[i];
}
max=a[i]+max;
}
if((max%10)!=0)
printf("%d",max);
else{
max = max -min;
printf("%d",max);
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:19: error: expected identifier before '(' token
   11 | if((a[i]%10)!=0)&&(min >a[i])){
      |                   ^
main.c:11:30: error: expected statement before ')' token
   11 | if((a[i]%10)!=0)&&(min >a[i])){
      |                              ^
Language: C++

#include <iostream>
#include <algorithm>
#include <cstdio>
using namespace std;
typedef long long ll;

int s [101];
int a [1000000000000];
int arrow = 0;
int n;
int mini = 1000000000;
int maxi = 0;


void dfs(int sum, int k){
	if(k == n) {
		if(sum % 10 == 0) {
			a[arrow++] = 0;
			mini = 0;
		}
		else {
			maxi = max(maxi, sum);
			mini = min(mini, sum);
		}
	}

	else{
		dfs(sum + s[k], k + 1);
		dfs(sum, k + 1);
	} 
	return;
}

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

	dfs(0, 0);

	
	cout << maxi - mini << endl;

	return 0;


}

Compiler output:
/tmp/ccvrzoF5.o: in function `dfs(int, int)':
a.cc:(.text+0x10): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccvrzoF5.o
a.cc:(.text+0x4d): relocation truncated to fit: R_X86_64_PC32 against symbol `arrow' defined in .bss section in /tmp/ccvrzoF5.o
a.cc:(.text+0x56): relocation truncated to fit: R_X86_64_PC32 against symbol `arrow' defined in .bss section in /tmp/ccvrzoF5.o
a.cc:(.text+0x88): relocation truncated to fit: R_X86_64_PC32 against symbol `maxi' defined in .bss section in /tmp/ccvrzoF5.o
a.cc:(.text+0x98): relocation truncated to fit: R_X86_64_PC32 against symbol `maxi' defined in .bss section in /tmp/ccvrzoF5.o
/tmp/ccvrzoF5.o: in function `main':
a.cc:(.text+0x107): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccvrzoF5.o
a.cc:(.text+0x155): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccvrzoF5.o
a.cc:(.text+0x16f): relocation truncated to fit: R_X86_64_PC32 against symbol `maxi' defined in .bss section in /tmp/ccvrzoF5.o
collect2: error: ld returned 1 exit status
Language: C++

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

int main(int argc, char const *argv[]) {
  int N;
  cin>>N;
  vector<int> s(N);
  int max=0;
  int tmp=0;
  for (size_t i = 0; i < N; i++) {
    cin>>s[i];
  }
  sort(s.begin(),s.end());
  for (size_t i = 0; i < N; i++) {
    max+=s[i];
  }
  for (size_t i = 0; i < N; i++) {
    if(max%10!=0){
      printf("%d\n", max);
      return 0;
    }
    max-=s[i];
  }
  printf("0\n");

  return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:16:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   16 |   sort(s.begin(),s.end());
      |   ^~~~
      |   short
Language: C++


#define fi first
#define se second
#define mp make_pair
#define pb push_back

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

int main(){
    long int n; cin>>n;long int a[n];long int ans = 0;long int max = 0;
    for (int i = 0; i < n; i++){
        cin>>a[i]; ans += a[i];
    }
    if(ans%10 == 0){
        for (int i = 0; i < n; i++){
            ans -= a[i];
            if (ans%10 != 0){
                if (max < ans){
                    max = ans;
                    //ans += a[i];
                }          
            }
            else {
                ans += a[i];
            }
        }
        cout << max; return 0;
    }
    
    if (ans%10 == 0){cout<<'0';return 0;}
    cout<<ans;
}

Compiler output:
a.cc:8:9: error: 'pair' does not name a type
    8 | typedef pair<int,int> ii;
      |         ^~~~
a.cc:9:9: error: 'vector' does not name a type
    9 | typedef vector<int> vi;
      |         ^~~~~~
a.cc: In function 'int main()':
a.cc:12:17: error: 'cin' was not declared in this scope
   12 |     long int n; cin>>n;long int a[n];long int ans = 0;long int max = 0;
      |                 ^~~
a.cc:29:9: error: 'cout' was not declared in this scope
   29 |         cout << max; return 0;
      |         ^~~~
a.cc:32:22: error: 'cout' was not declared in this scope
   32 |     if (ans%10 == 0){cout<<'0';return 0;}
      |                      ^~~~
a.cc:33:5: error: 'cout' was not declared in this scope
   33 |     cout<<ans;
      |     ^~~~
Language: C

#include<stdio.h>
#include<stdlib.h>
int main(){
int n,s[110],i,sum,temp;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&s[i]);
}
for(i=0;i<n-1;i++){
for(j=0;j<n-i-1;j++){
if(s[j]>s[j+1]){
temp=s[j];
s[j]=s[j+1];
s[j+1]=temp;
temp=s[j];
}
}
}
sum=0;
for(i=0;i<n;i++){
sum=sum+s[i];
}
i=0;
while(sum%10==0){
sum=sum-s[i];
i++;
}
printf("%d",sum);





return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:5: error: 'j' undeclared (first use in this function)
   10 | for(j=0;j<n-i-1;j++){
      |     ^
main.c:10:5: note: each undeclared identifier is reported only once for each function it appears in
Language: Java

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

		if(sum%10==0)
		{
			for(int i=0;i<N;i++)
			{
				if ((sum-arry[i])%10!=0)
				{sum-=arry[i];
			         System.out.println(sum);
			         break;} 
			        else 
                                 {System.out.println("0");
			          break; }		    
			}
		}
		else System.out.println(sum);
	
}
}

Compiler output:
Main.java:3: error: cannot find symbol
		Scanner sc= new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
		Scanner sc= new Scanner(System.in);
		                ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner stdin = new Scanner(System.in);
		int k = 0, n = 0;
		boolean b = true;
		n = stdin.nextInt();
		int[] a = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = stdin.nextInt();
			k = k + a[i];
			if (a[i] % 10 != 0) {
				b = false;
			}
		}
		Arrays.sort(a);
		if (b) {
			System.out.println(0);
		} else {
			if (k % 10 != 0) {
				System.out.println(k);
			} else {
				for (int j = 0; j < n; j++) {
					if (a[j] % 10 != 0) {
						k = k - a[j];
					}
					if (k % 10 != 0) {
						System.out.println(k);
						break;
					}
				}
			}
		}

Compiler output:
Main.java:36: error: reached end of file while parsing
		}
		 ^
1 error
Language: Java

import com.sun.tools.hat.internal.util.ArraySorter;

import java.util.Arrays;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int total = 0;

        int[] ans = new int[n];

        for (int i = 0; i < n; i++) {
            ans[i] = sc.nextInt();
            total += ans[i];
        }

        Arrays.sort(ans);

        for (int i = 1; i < n; i++){
            if(i==n){
                System.out.println("0");
            }
            if (total % 10 == 0) {
                total=0;
                for(int j=i;j<ans.length;j++){
                    total+=ans[j];
                }
            } else {
                System.out.println(total);
                break;
            }
        }
    }


}


Compiler output:
Main.java:1: error: package com.sun.tools.hat.internal.util does not exist
import com.sun.tools.hat.internal.util.ArraySorter;
                                      ^
1 error
Language: C++

#include <stdio.h>
#include<bits/stdc++.h>
int main()
{
    int N;
    int i;
    scanf("%d",&N);

    int a[105]={0};
    int sum=0;
   for(i=1;i<=N;i++){
    scanf("%d",&a[i]);
      sum+=a[i];
   }
   sort(a,a+N);
   for(i=1;i<=N;i++){
      if(sum%10==0)
        sum-=a[i];
    else if(sum%10!=0&&sum>=0)
        printf("%d",sum);
   }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:4: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   15 |    sort(a,a+N);
      |    ^~~~
      |    std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:2:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
Language: C++

#include<bits/stdc++.h>

using namespace std;

int main ()
{
    int a[200],n;
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>a[i];
    sort(a,a+n);
    int sum=0;
    for(int i=n-1;i>=0;i--){
        if((sum+a[0])%10) sum+=a[i];
    }
    cout<<sum<<endl;


    return 0;
}
`

Compiler output:
a.cc:21:1: error: stray '`' in program
   21 | `
      | ^
Language: C++

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

int main(void){
  int quest;
  int *dat;
  int sum = 0;
  int min = 150;

  scanf("%d",&quest);

  dat = malloc(sizeof(int) * quest);
 
  int i;
  for(i = 0; i < quest;i++){
    scanf("%d",&dat[i]);
    sum += dat[i];
    if(dat[i] < min && dat[i] % 10 != 0){
      min = dat[i];
    }
  }
/*
  for(i = 0; i < quest;i++){
    printf("%d\n",dat[i]);
  }
*/
    if(sum % 10 == 0){
      if(min != 150){
        sum = sum - min;
        printf("%d",sum);
      }else{
         printf("0");
      }
    }else{
      printf("%d",sum);
    }
    


  free(dat);

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:15: error: invalid conversion from 'void*' to 'int*' [-fpermissive]
   12 |   dat = malloc(sizeof(int) * quest);
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~~~
      |               |
      |               void*
Language: C++

#include<iostream>
using namespace std;
void masatoy(int [101],int,int);
int sum1 = 0, sum2 = 0;
int max = 0, n;
int main() {
	int  a[101]={0};
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	masatoy(a, 0, 0);
	cout << max << endl;
}
void masatoy(int b[101],int wa,int i) {
	if (wa % 10 != 0 && wa > max) {
		max = wa;
	}
	if (i + 1 <= n) {
		masatoy(b, wa + b[i], i + 1);
		masatoy(b, wa, i + 1);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: reference to 'max' is ambiguous
   13 |         cout << max << endl;
      |                 ^~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:                 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:5:5: note:                 'int max'
    5 | int max = 0, n;
      |     ^~~
a.cc: In function 'void masatoy(int*, int, int)':
a.cc:16:34: error: reference to 'max' is ambiguous
   16 |         if (wa % 10 != 0 && wa > max) {
      |                                  ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:                 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:5:5: note:                 'int max'
    5 | int max = 0, n;
      |     ^~~
a.cc:17:17: error: reference to 'max' is ambiguous
   17 |                 max = wa;
      |                 ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:                 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:5:5: note:                 'int max'
    5 | int max = 0, n;
      |     ^~~
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<bits/stdc++.h>
#include<algorithm>
using namespace std;
int main()
{
	int n,i,j;
	scanf("%d",&n);
	int m[n];
	for(i=0;i<n;i++)
	{
		scanf("%d",&m[i]);
	}

	sort(m,m+n);
	int res=0;

	
	for(j=n-1;j>=0;j--)
	{
		if((res+m[j])%10!=0)
		{
			res=res+m[j];
		}
	}

	printf("%d\n",res);
	
}

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

#include<stdio.h>
#include<algorithm>
using namespace std;
int num[101];
int main(){
	int n,i;
	while(scanf("%d",&n)!=EOF){
		int sum=0,s=0;
		for(i=0;i<n;i++){
			scanf("%d",&num[i]);
			sum+=num[i];
		}
		sort(num,num+n);
		while(sum%10==0){
			sum-=num[s++];
			if(s==n)
				break;
		}
		printf("%d\n",sum);
	}
	return 0;
}

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

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

int main(void)
{

    int n;
    scanf("%d", &n);
    int s, sum = 0, min = 100;
     for (int i = 0; i < n; ++i){
        scanf("%d", &s);
        sum += s;
        if (s % 10 && min > s )
            min = s;
    }
    if (sum % 10)
        printf("%d\n", sum);
    else{
        if (min % 10)
            printf("%d"\n, sum - min);
        else
            printf("%d\n", 0);
    }
    return 0;
}

Compiler output:
a.cc:20:24: error: stray '\' in program
   20 |             printf("%d"\n, sum - min);
      |                        ^
a.cc: In function 'int main()':
a.cc:20:24: error: expected ')' before 'n'
   20 |             printf("%d"\n, sum - min);
      |                   ~    ^~
      |                        )
Language: C

#include <stdio.h>

int main(){
  int n, i, sum, s[150];
  scanf("%d", &n);
  for (i=0;i<n;i++)
  {
    scanf("%d", &s[i]);
    sum+=s[i];
  }
  i=0;
  while(1){
    if(sum%10!=0||sum==0){
      break;
    }else{
      sum-=s[i];
      i++;
    }

  printf("%d\n", sum);
  return 0;
}


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

#include <stdio.h>

int bezero(int n)
{
	if(n%10==0)return 0;
	return n;
}

int max(int N,int s[N])
{
	int sum=0;
	int max=-114514;
	for(int i=0;i<N;i++)
		sum+=s[i];
	if(bezero(sum)!=0)return sum;
	for(int i=0;i<N;i++)
	{
		int x=bezero(sum-s[i]);
		if(max<x)
			max=x;
	}
	return max;
}

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


Compiler output:
a.cc:9:22: error: use of parameter outside function body before ']' token
    9 | int max(int N,int s[N])
      |                      ^
a.cc: In function 'int max(...)':
a.cc:13:23: error: 'N' was not declared in this scope
   13 |         for(int i=0;i<N;i++)
      |                       ^
a.cc:14:22: error: 's' was not declared in this scope
   14 |                 sum+=s[i];
      |                      ^
a.cc:16:23: error: 'N' was not declared in this scope
   16 |         for(int i=0;i<N;i++)
      |                       ^
a.cc:18:34: error: 's' was not declared in this scope
   18 |                 int x=bezero(sum-s[i]);
      |                                  ^
Language: C

#include <stdio.h>

int main(){
  int n, i, sum, s[150];
  scanf("%d", %n);
  for (i=0;i<n;i++)
  {
    scanf("%d", s[i]);
    sum+=s[i];
  }
  i=0;
  while(1){
    if(sum%10!=0){
      break;
    }else{
      sum-=s[i];
      i++;
    }

  }
  printf("%d\n", sum);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:5:15: error: expected expression before '%' token
    5 |   scanf("%d", %n);
      |               ^
Language: C++

#include <iostream>
#include <vector>
#include <numeric>

using namespace std;

int main() {
    int N;
    cin >> N;
    vector<int> s(N);
    for (int i = 0; i < N; ++i) {
        cin >> s[i];
    }
    sort(s.begin(), s.end());
    int ans = accumulate(s.begin(), s.end(), 0);
    for (int j = 0; j < N; ++j) {
        if (ans % 10 != 0) {
            cout << ans;
            return 0;
        }
        ans -= s[j];
    }
    cout << 0;
}

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

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;

int p[110],n,sum;

int main(){
 scanf("%d",&n);
 for(int i = 0 ; i < n ; i++) scanf("%d",p+i),sum+=p[i],p[i] = p[i]%10==0?0:p[i];
 sort(p,p+n);
 if( sum % 10 == 0 ){
  for(int j = 0 ; j < n ; j++){
   sum-=p[j];
   if(sum%10) break;
  }
 }else sum = 0;
 printf("%d\n",sum);
 return 0;
}

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

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

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

  int n;
  cin >> n;
  vector<int> s(n);
  for(int i = 0; i < n; i++){
    cin >> s[i];
  }
  sort(s.begin(),s.end());
  long sum = 0;
  for(int i = n - 1; i >= 0; i--){
    sum += s[i];
  }
  for(int i = 0; i < n; i++){
    if(sum % 10 != 0){
      cout << sum << endl;
      return 0;
    }
    sum -= s[i];
  }
  for(int n - 1; i >= 0; i--){
    if(s[i] % 10 != 0){
      cout << s[i] << endl;
      return 0;
    }
  }
  cout << 0 << endl;  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:12: error: expected ';' before '-' token
   30 |   for(int n - 1; i >= 0; i--){
      |            ^~
      |            ;
a.cc:30:18: error: 'i' was not declared in this scope
   30 |   for(int n - 1; i >= 0; i--){
      |                  ^
a.cc:30:24: error: expected ')' before ';' token
   30 |   for(int n - 1; i >= 0; i--){
      |      ~                 ^
      |                        )
a.cc:30:26: error: 'i' was not declared in this scope
   30 |   for(int n - 1; i >= 0; i--){
      |                          ^
Language: C++

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

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

  int n;
  cin >> n;
  vector<int> s(n);
  for(int i = 0; i < n; i++){
    cin >> s[i];
  }
  sort(s.begin(),s.end());
  long sum = 0;
  for(int i = n - 1; i >= 0; i--){
    sum += s[i];
  }
  for(int i = 0; i < n; i++){
    if(sum % 10 != 0){
      cout << sum << endl;
      return 0;
    }
    sum -= s[i];
  }
  for(int n - 1; i >= 0; i++){
    if(s[i] % 10 != 0){
      cout << s[i] << endl;
      return 0;
    }
  }
  cout << 0 << endl;  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:12: error: expected ';' before '-' token
   30 |   for(int n - 1; i >= 0; i++){
      |            ^~
      |            ;
a.cc:30:18: error: 'i' was not declared in this scope
   30 |   for(int n - 1; i >= 0; i++){
      |                  ^
a.cc:30:24: error: expected ')' before ';' token
   30 |   for(int n - 1; i >= 0; i++){
      |      ~                 ^
      |                        )
a.cc:30:26: error: 'i' was not declared in this scope
   30 |   for(int n - 1; i >= 0; i++){
      |                          ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#pragma region atcoder
#include <atcoder/dsu>
using namespace atcoder;
#pragma endregion
#pragma region macros
using ll = long long;
using vi = vector<int>;
using vs = vector<string>;
using vl = vector<ll>;
using vb = vector<bool>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;
using vvc = vector<vector<char>>;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rrep(i, n) for(int i = n - 1; i >= 0; i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#pragma endregion
#pragma region debug for var, v, vv
#define debug(var)  do{std::cout << #var << " : ";view(var);}while(0)
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){cout << endl;int cnt = 0;for(const auto& v : vv){cout << cnt << "th : "; view(v); cnt++;} cout << endl;}
#pragma endregion
const ll mod = 1000000007;
const int inf = 1001001001;
const ll INF = 1001001001001001001;
const int MAX = 2000005;
template<class T>bool chmax(T &a, const T b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T b) { if (b<a) { a=b; return 1; } return 0; }
ll modpow(ll a, ll p){ll ret = 1; while(p){if(p & 1){ret = ret * a % mod;} a = a * a % mod; p >>= 1;} return ret;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

/*-----------------------------------------------------------------------------------------------------*/
int main(){
    int n; cin >> n;
    ll a, b; cin >> a >> b;
    a -= b;
    vl h(n);
    rep(i,n) cin >> h[i];
    ll ok = (ll)1e9 + 1, ng = 0;
    while(ok - ng > 1){
        ll mid = (ok + ng) / 2;
        auto f = [&](){
            ll num = 0;
            vl res = h;
            for(int i = 0; i < n; i++) res[i] -= b * mid;
            for(int i = 0; i < n; i++){
                if(res[i] > 0) num += (res[i] + a - 1) / a;
            }
            if(num <= mid) return true;
            else return false;
        };
        if(f()) ok = mid;
        else ng = mid;
    }
    cout << ok << endl;
}

Compiler output:
a.cc:4:10: fatal error: atcoder/dsu: No such file or directory
    4 | #include <atcoder/dsu>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

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

int charToInt(char c){
    char zero_num = '0';
    return (int)c - (int)zero_num;
}

signed main(){
 int N, A, B;
 cin>>N>>A>>B;
 vec_int h(N);
 rep(i,N)cin>>h.at(i);

//一撃で終わる場合
    int kaisuu0=0;
for(int i=0;i<N;i++){
    if(h.at(i)>B){
        if(h.at(i)>A){
            break;
        }
        kaisuu++;
    }
}
    if(kaisuu0<2){
        cout<<1<<endl;
        return 0;
    }
int upper_num = 2*pow(10,9);
int lower_num = 1;

while(lower_num+1<upper_num){
    int med = (lower_num+upper_num)/2;
    
    int kaisuu = 0;
    for(int i=0;i<N;i++){
        if(h.at(i)-B*med>0){
            kaisuu += (h.at(i)-B*med)/(A-B);
            if((h.at(i)-B*med)%(A-B)!=0){
                kaisuu += 1;
            }
        }
    }
    if(kaisuu<=med){
        upper_num = med;
    }else{
        lower_num = med;
    }
}
cout<<upper_num<<endl;


    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:9: error: 'kaisuu' was not declared in this scope; did you mean 'kaisuu0'?
   28 |         kaisuu++;
      |         ^~~~~~
      |         kaisuu0
Language: C++

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

int main(){
  int n, a, b; cin >> n >> a >> b;
  int hp[n];
  int high = 0;
  for(int i = 0; i < n; ++i) {
	cin >> hp[i];
    if(high < hp[i]) high = hp[i];
  }
  int max_turn = (high + b -1)/b;
  max_turn++;
  int addition = a-b;
  while(max_turn--){
	int cnt = 0;
    for(int i = 0; i < n; ++i){
      if(hp[i] <= (long long)b * (long long)max_turn) continue;
      else {
        cnt += (hp[i]-b*max_turn + addition -1)/addition;
      }
    }
    if(cnt > max_turn){
	  cout << ++max_turn << endl;
      return;
    }
  }
  return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:7: error: return-statement with no value, in function returning 'int' [-fpermissive]
   25 |       return;
      |       ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ALL(x) (x).begin(),(x).end()
#define COUT(x) cout<<(x)<<"\n"
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define REP(i, n) for(int i=0;i<n;i++)
#define YES(x) cout<<(x?"YES":"NO")<<"\n"
#define Yes(x) cout<<(x?"Yes":"No")<<"\n"
#define dump(x) cout<<#x<<" = "<<(x)<<"\n"
#define endl "\n"
using G = vector<vector<int>>;
using M = map<int,int>;
using P = pair<int,int>;
using PQ = priority_queue<int>;
using PQG = priority_queue<int,vector<int>,greater<int>>;
using V = vector<int>;
using ll = long long;
using edge = struct { int to; int cost; };
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

int n,a,b;
vector<int> h;

bool enough(int idx, ll mid, ll k) {
  ll k = b * mid;
  for (int i = idx; i < n; i++) {
    ll nh = h[i]-k;
    mid -= nh/(a-b) + (nh%(a-b) > 0);
  }
  return 0 <= mid;
}

int main() {
  IOS;
  cin >> n >> a >> b;
  h.resize(n);
  REP(i,n) cin >> h[i];

  sort(ALL(h));

  int ng = 0, ok = h[n-1]/b+1;
  while(abs(ok-ng) > 1) {
    ll mid = (ok+ng)/2;
    ll key = b * mid;
    auto it = upper_bound(ALL(h), key);
    int idx = it-h.begin();

    if (enough(idx, mid, key)) ok = mid;
    else ng = mid;
  }

  COUT(ok);
  return 0;
}

Compiler output:
a.cc: In function 'bool enough(int, ll, ll)':
a.cc:29:6: error: declaration of 'll k' shadows a parameter
   29 |   ll k = b * mid;
      |      ^
a.cc:28:33: note: 'll k' previously declared here
   28 | bool enough(int idx, ll mid, ll k) {
      |                              ~~~^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ALL(x) (x).begin(),(x).end()
#define COUT(x) cout<<(x)<<"\n"
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define REP(i, n) for(int i=0;i<n;i++)
#define YES(x) cout<<(x?"YES":"NO")<<"\n"
#define Yes(x) cout<<(x?"Yes":"No")<<"\n"
#define dump(x) cout<<#x<<" = "<<(x)<<"\n"
#define endl "\n"
using G = vector<vector<int>>;
using M = map<int,int>;
using P = pair<int,int>;
using PQ = priority_queue<int>;
using PQG = priority_queue<int,vector<int>,greater<int>>;
using V = vector<int>;
using ll = long long;
using edge = struct { int to; int cost; };
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

int n,a,b;
vector<int> h;

bool enough(int idx, ll mid) {
  ll k = b * mid; //
  for (int i = idx; i < n; i++) {
    ll nh = h[i]-k;
    mid -= nh/(a-b) + (nh%(a-b) > 0);
  }
  return 0 <= mid;
}

int main() {
  IOS;
  cin >> n >> a >> b;
  h.resize(n);
  REP(i,n) cin >> h[i];

  sort(ALL(h));

  int ng = 0, ok = h[n-1]/b+1;
  while(abs(ok-ng) > 1) {
    ll mid = (ok+ng)/2;
    auto it = upper_bound(ALL(h), key);
    int idx = it-h.begin();

    if (enough(idx, mid)) ok = mid;
    else ng = mid;
  }

  COUT(ok);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:35: error: 'key' was not declared in this scope; did you mean 'key_t'?
   48 |     auto it = upper_bound(ALL(h), key);
      |                                   ^~~
      |                                   key_t