criyle/codenet-compile-errors huggingface dataset:
Language: Java

import java.util.Arrays;
import java.util.Iterator;
import java.util.PrimitiveIterator;
import java.util.Scanner;
import java.util.function.BinaryOperator;
import java.util.function.IntFunction;
import java.util.stream.IntStream;
import java.util.stream.Stream;

class Main{

	private void solve(){
		int n=gInt(),a=gInt(),b=gInt(),h[]=ints(n).toArray();
		System.out.println(bin(1,100000000,i->f(a,b,h,i)));
	}
	int bin(int l,int r,IntFunction<Integer> f){
		while(true) {
			System.out.println(l+" "+r);
			int mid=(l+r)/2;
			int v=f.apply(mid);
			if(v==0)
				return mid;
			if(v>0)
				l=mid+1;
			else
				r=mid-1;
		}
	}
	int f(int a,int b,int[] h,int i){
		return Arrays.stream(h)
				.map(o->(Math.max(0,o-b*i)+a-b-1)/(a-b))
				.sum()
				-i;
	}

	public static class Merger<T>{
		private T v;
		private BinaryOperator<T>f;
		public Merger(T init,BinaryOperator<T>merge){
			v=init;
			f=merge;
		}
		public T update(T t) {
			return v=f.apply(v,t);
		}
		public T get() {
			return v;
		}
	}

	public static void main(String[]$){
		new Main().solve();
	}

	static Scanner s=new Scanner(System.in);


	static int gInt(){
		return s.nextInt();
	}

	static long gLong(){
		return s.nextLong();
	}

	static long gDouble(){
		return s.nextLong();
	}


	static Range rep(int i){
		return new Range(i);
	}
	static Range rep(int f,int t,int d){
		return new Range(f,t,d);
	}
	static Range rep(int f,int t){
		return rep(f,t,1);
	}
	static Range rrep(int f,int t){
		return rep(f,t,-1);
	}

	static class Range implements Iterable<Integer>,PrimitiveIterator.OfInt{

		int to,cur,d;

		Range(int from,int to,int d){
			this.cur=from-d;
			this.to=to;
			this.d=d;
		}

		Range(int n){
			this(0,n-1,1);
		}

		@Override
		public Iterator<Integer> iterator(){
			return this;
		}

		@Override
		public boolean hasNext(){
			return cur+d==to||(cur!=to&&(cur<to==cur+d<to));
		}

		@Override
		public int nextInt(){
			return cur+=d;
		}
	}


	static IntStream REPS(int v){
		return IntStream.range(0,v);
	}

	static IntStream REPS(int l,int r){
		return IntStream.rangeClosed(l,r);
	}


	static IntStream ints(int n){
		return REPS(n).map(i->gInt());
	}

	static Stream<String> strs(int n){
		return REPS(n).mapToObj(i->s.next());
	}

}/

Compiler output:
Main.java:132: error: class, interface, enum, or record expected
}/
 ^
1 error
Language: C++

#include <iostream>
#include <cctype>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <string>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
const int INF = 100000000, mod = 1000000007;
using namespace std;

long long n, a, b, h[100000];

bool check(long long pos) {
    long long count = 0;
    for (int i = 0; i < n; i++) {
        long long tmp = h[i] - b*pos, damage = a - b;
        res += max(0LL, (tmp + damage - 1) / damage);
    }
    return count <= pos;
}

int main() {
    cin >> n >> a >> b;
    for (int i = 0; i < n; i++) cin >> h[i];
    long long left = 0, right = 1000000000;
    while (right-left>1) {//h[left]~h[right]
        long long pos = (left + right) / 2;
        if (check(pos)) right = pos;
        else left = pos;
    }
    cout << right << endl;
    return 0;
}

Compiler output:
a.cc: In function 'bool check(long long int)':
a.cc:25:9: error: 'res' was not declared in this scope
   25 |         res += max(0LL, (tmp + damage - 1) / damage);
      |         ^~~
Language: C++

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

bool tobo(ll mid){
	ll temp[N];
	ll po = 0;
	for(ll i = 0; i < N; ++i){
		ll yo = h[i] - mid * B;
		if(yo > 0) po += yo / (A - B) + (yo % (A - B) > 0);
	}
	if(yo > mid) return 0;
	else return 1;
}

int main(){
	ll N ,A, B; cin >> N >> A >> B;
	ll h[N];
	for(ll i = 0; i < N; ++i) cin >> h[i];
	ll upper = 1e14, lower = 0;
	while(upper - lower > 1){
		ll mid = (upper + lower) / 2;
		if(!tobo(upper, lower)) lower = mid;
		else upper = mid;
	}
	cout << (tobo(lower) ? lower : upper) << endl;
	return 0;
}

Compiler output:
a.cc: In function 'bool tobo(ll)':
a.cc:6:17: error: 'N' was not declared in this scope
    6 |         ll temp[N];
      |                 ^
a.cc:9:25: error: 'h' was not declared in this scope
    9 |                 ll yo = h[i] - mid * B;
      |                         ^
a.cc:9:38: error: 'B' was not declared in this scope
    9 |                 ll yo = h[i] - mid * B;
      |                                      ^
a.cc:10:40: error: 'A' was not declared in this scope
   10 |                 if(yo > 0) po += yo / (A - B) + (yo % (A - B) > 0);
      |                                        ^
a.cc:12:12: error: 'yo' was not declared in this scope; did you mean 'po'?
   12 |         if(yo > mid) return 0;
      |            ^~
      |            po
a.cc: In function 'int main()':
a.cc:23:25: error: too many arguments to function 'bool tobo(ll)'
   23 |                 if(!tobo(upper, lower)) lower = mid;
      |                     ~~~~^~~~~~~~~~~~~~
a.cc:5:6: note: declared here
    5 | bool tobo(ll mid){
      |      ^~~~
a.cc: In function 'bool tobo(ll)':
a.cc:14:1: warning: control reaches end of non-void function [-Wreturn-type]
   14 | }
      | ^
Language: C++

#include<cstdio>
int n,a,b,h[100000],i,l,m,r;
long long x;
main(){
  for(cin>>n>>a>>b),a-=b;i<n;l=1,r=1e9) cout<<h+i++;
  while(l<r){
    m=(l+r)/2;
    for(x=i=0;i<n;++i)h[i]>(long long)m*b?x+=(h[i]-m*b+a-1)/a:0;
    x<=m?r=m:l=m+1;
  }
  cout<<l<<endl;
}

Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:5:7: error: 'cin' was not declared in this scope
    5 |   for(cin>>n>>a>>b),a-=b;i<n;l=1,r=1e9) cout<<h+i++;
      |       ^~~
a.cc:5:41: error: 'cout' was not declared in this scope
    5 |   for(cin>>n>>a>>b),a-=b;i<n;l=1,r=1e9) cout<<h+i++;
      |                                         ^~~~
a.cc:11:3: error: 'cout' was not declared in this scope
   11 |   cout<<l<<endl;
      |   ^~~~
a.cc:11:12: error: 'endl' was not declared in this scope
   11 |   cout<<l<<endl;
      |            ^~~~
Language: C++

#include <stdio.h>
#include <queue>
#include <vector>
#include <algorithm>
#include <iostream>
using namespace std;
ll n,attack1,attack2;
vector<int> hp;
const ll INF=1e9;
inline bool check(ll x){
	ll cost=0;
	ll i;
	for(i=0;i<hp.size();i++){
		if(hp[i]-x*attack2>0){
			ll tmp=hp[i]-x*attack2;
			ll tmp2=(tmp+(attack1-attack2)-1)/(attack1-attack2);
			if(tmp>0)cost+=tmp2;
		}
	}
	return cost<=x;
}
int main(){
	scanf("%d%d%d",&n,&attack1,&attack2);
	hp.resize(n);
	ll i;
	for(i=0;i<n;i++){
		scanf("%d",&hp[i]);
	}
	ll l=1,r=INF,ans;
	while(l<=r){
		ll mid=(l+r)>>1;
		if(check(mid)){
			ans=mid;
			r=mid-1;
		}
		else{
			l=mid+1;
		}
	}
	printf("%I64d\n",ans);
	return 0;
}

Compiler output:
a.cc:7:1: error: 'll' does not name a type
    7 | ll n,attack1,attack2;
      | ^~
a.cc:9:7: error: 'll' does not name a type
    9 | const ll INF=1e9;
      |       ^~
a.cc:10:19: error: 'll' was not declared in this scope
   10 | inline bool check(ll x){
      |                   ^~
a.cc: In function 'int main()':
a.cc:23:25: error: 'n' was not declared in this scope
   23 |         scanf("%d%d%d",&n,&attack1,&attack2);
      |                         ^
a.cc:23:28: error: 'attack1' was not declared in this scope
   23 |         scanf("%d%d%d",&n,&attack1,&attack2);
      |                            ^~~~~~~
a.cc:23:37: error: 'attack2' was not declared in this scope
   23 |         scanf("%d%d%d",&n,&attack1,&attack2);
      |                                     ^~~~~~~
a.cc:25:9: error: 'll' was not declared in this scope
   25 |         ll i;
      |         ^~
a.cc:26:13: error: 'i' was not declared in this scope
   26 |         for(i=0;i<n;i++){
      |             ^
a.cc:29:11: error: expected ';' before 'l'
   29 |         ll l=1,r=INF,ans;
      |           ^~
      |           ;
a.cc:30:15: error: 'l' was not declared in this scope
   30 |         while(l<=r){
      |               ^
a.cc:30:18: error: 'r' was not declared in this scope
   30 |         while(l<=r){
      |                  ^
a.cc:31:19: error: expected ';' before 'mid'
   31 |                 ll mid=(l+r)>>1;
      |                   ^~~~
      |                   ;
a.cc:32:26: error: 'mid' was not declared in this scope
   32 |                 if(check(mid)){
      |                          ^~~
a.cc:32:29: error: 'check' cannot be used as a function
   32 |                 if(check(mid)){
      |                             ^
a.cc:33:25: error: 'ans' was not declared in this scope; did you mean 'abs'?
   33 |                         ans=mid;
      |                         ^~~
      |                         abs
a.cc:40:26: error: 'ans' was not declared in this scope; did you mean 'abs'?
   40 |         printf("%I64d\n",ans);
      |                          ^~~
      |                          abs
Language: C++

//Widespread
priority_queue <int> q;
int h,i,j,k,t,deathline,a,b,n,ans=0;
int main(){
	cin>>n>>a>>b;
	deathline=0;
	rep(i,0,n){
		cin>>h;q.push(h); 
	}
	a-=b;
	while(q.top()>deathline){
		t=q.top();q.pop();
		t-=a;q.push(t);
		ans++;
		deathline+=b;
	}
	cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc:2:1: error: 'priority_queue' does not name a type
    2 | priority_queue <int> q;
      | ^~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope
    5 |         cin>>n>>a>>b;
      |         ^~~
a.cc:7:9: error: 'rep' was not declared in this scope
    7 |         rep(i,0,n){
      |         ^~~
a.cc:11:15: error: 'q' was not declared in this scope
   11 |         while(q.top()>deathline){
      |               ^
a.cc:17:9: error: 'cout' was not declared in this scope
   17 |         cout<<ans<<endl;
      |         ^~~~
a.cc:17:20: error: 'endl' was not declared in this scope
   17 |         cout<<ans<<endl;
      |                    ^~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<cstdio>
#include<string>
#include<cstring> 
#include<cassert>
#include<cmath>
#include<sstream>
#include<fstream>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<stack>
#include<bitset>
using namespace std;
long long h[100005],tem;
long long n,a,b;
bool check(long long mid)
{
	long long res=0;
	for(int i=0;i<n;i++)
	{
		tem=(long long)(h[i])-(long long)(mid*b);
		if(tem>0) res+=long long(tem/a)+(tem%a!=0);
	}
	return res<=mid;
}
int main()
{
	cin>>n>>a>>b;
	for(int i=0;i<n;i++)
	{
		cin>>h[i];
	}
	a-=b;
	long long l=0,r=1e15,mid,re=1e15;
	while(r>l+1)
	{
		mid=(l+r)/2ll;
		if(check(mid))
		{
			r=mid;
			re=min(mid,re);
		}
		else l=mid;
	}
	cout<<re;
}

Compiler output:
a.cc: In function 'bool check(long long int)':
a.cc:25:32: error: expected primary-expression before 'long'
   25 |                 if(tem>0) res+=long long(tem/a)+(tem%a!=0);
      |                                ^~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

typedef long long LL;
const int maxn = 1e5;
int n, a, b, m[maxn+3];

bool judge(LL x)
{
    LL sum = 0;
    for(int i=0; i<n; ++i)
    {
        LL t = m[i]-x*b;
        if(t>0)
        {
            sum += ceil(t*1.0/(a-b));
            if(sum > x || sum < 0)
                return false;
        }
    }
    return true;
}
int main()
{
    scanf("%d%d%d",&n,&a,&b);
    
    int imax = 0;
    for(int i=0; i<n; ++i) scanf("%d",&m[i]), imax = max(imax, m[i]);
    LL l=0, r=1e14;
    while(l<r)
    {
        LL mid = (l+r)/2;
        if(judge(mid)) r=mid;
        else l=mid+1;
    }
    printf("%lld\n",mid);
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:21: error: 'mid' was not declared in this scope
   39 |     printf("%lld\n",mid);
      |                     ^~~
Language: C++

    #include <iostream>
    #include <vector>
    #include <algorithm>
    #include <cstdio>
    #include <queue>
    using namespace std;
     
    const int MAX_N = 10000;
    #define ll long long
    int N, A, B;
    vector<int> h;
    bool enough(int T)
    {
    	ll cnt = 0;
    	for (int i = 0; i < N; i++)
    	{
    		if (h[i] <= B*T) continue;
    		cnt += (h[i]-B*T) / (A-B)
    		if( (h[i]-B*T) % (A-B) ) cnt++;
    	}
    	return cnt <= T;
    }
     
     
    int main()
    {
    	//widespread
    	
    	cin >> N >> A >> B;
    	h.resize(N);
    	
    	for (int i = 0; i < N; i++)
    	{
    		cin>>h[i];
    	}
    	sort(h.begin(), h.end());
    	int l = -1;
    	int r = h.back() / B + 1;
    	while (r-l>1)
    	{
    		int m = (r+l) / 2;
    		(enough(m) ? r : l) = m;
    	}
    	cout << r << endl;
    	return 0;
    }

Compiler output:
a.cc: In function 'bool enough(int)':
a.cc:18:42: error: expected ';' before 'if'
   18 |                 cnt += (h[i]-B*T) / (A-B)
      |                                          ^
      |                                          ;
   19 |                 if( (h[i]-B*T) % (A-B) ) cnt++;
      |                 ~~
Language: C++

#include "stdafx.h"
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <queue>
using namespace std;

const int MAX_N = 10000;
#define ll long long
int N, A, B;
vector<int> h;
bool enough(int T)
{
	ll cnt = 0;
	for (int i = 0; i < N; i++)
	{
		if (h[i] <= B*T) continue;
		cnt += (int)ceil((double)(h[i]-B*T) / (A-B));
	}
	return cnt <= T;
}


int main()
{
	//widespread
	
	cin >> N >> A >> B;
	h.resize(N);
	
	for (int i = 0; i < N; i++)
	{
		cin>>h[i];
	}
	sort(h.begin(), h.end());
	int l = -1;
	int r = h.back() / B + 1;
	while (r-l>1)
	{
		int m = (r+l) / 2;
		(enough(m) ? r : l) = m;
	}
	cout << r << endl;
	return 0;
}


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

int main()
{
	//widespread
	int N,A,B;
	scanf("%d %d %d", &N,&A,&B);
	vector<int> h(N);
	for (int i = 0; i < N; i++)
	{
		scanf("%d", &h[i]);
	}
	int cnt= 0;
	while (true)
	{
		bool flag = true;
		int max = h[0];
		int index = 0;
		for (int i = 0; i < N; i++)
		{
			if (max < h[i])
			{
				max = h[i];
				index = i;
			}
			if (h[i] > 0)
			{
				flag = false;
			}
		}
		if (flag) break;
		cnt++;
		for (int i = 0; i < N; i++)
		{
			if (index == i)
			{
				h[i] -= A;
			}
			else
			{
				h[i] -= B;
			}
		}
	}
	cout << cnt << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'scanf' was not declared in this scope
    5 |         scanf("%d %d %d", &N,&A,&B);
      |         ^~~~~
a.cc:6:9: error: 'vector' was not declared in this scope
    6 |         vector<int> h(N);
      |         ^~~~~~
a.cc:6:16: error: expected primary-expression before 'int'
    6 |         vector<int> h(N);
      |                ^~~
a.cc:9:30: error: 'h' was not declared in this scope
    9 |                 scanf("%d", &h[i]);
      |                              ^
a.cc:15:27: error: 'h' was not declared in this scope
   15 |                 int max = h[0];
      |                           ^
a.cc:43:9: error: 'cout' was not declared in this scope
   43 |         cout << cnt << endl;
      |         ^~~~
a.cc:43:24: error: 'endl' was not declared in this scope
   43 |         cout << cnt << endl;
      |                        ^~~~
Language: C++

#include <iostream>
#include <cstdio.h>
#include <math.h>
 
using namespace std;  
typedef long long LL;
 
int N, A, B, h[(int)1e5];
 
bool judge(LL K) {
    LL sum = 0;
    for(int i = 0; i < N; i++) {
        LL t = (LL)h[i]-K*B;
        if (t > 0) {
            sum += (int)ceil(t*1.0/(A-B));
            if(sum > K)
                return false;
        }
    }
    return true;
}
 
int main()
{
    cin >> N >> A >> B;
 
    for (int i = 0; i < N; i++)
        scanf("%ld", &h[i]);
 
    LL low = 0, high = 1e9;
 
    while (low < high) {
        LL mid = (low + high) / 2;
        if (judge(mid))
            high = mid;
        else
            low = mid+1;
    }
 
    cout << low << endl;
 
    return 0;
}

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

#include<iostream>

using namespace std;

int max_num(int *h, int& n)
{
    int i;
    int tmp=h[0];
    int ans=0;
    for(i=1;i<n;i++)
    {
        if(tmp<h[i])
        {
            tmp=h[i];
            ans=i;
        }
    }
    return ans;
}



int main()
{
    
    int n;
    int a,b;
    cin>>n>>a>>b;
    int h[n];
    int sum=0,t;
    int i;
    int max_mon;
    for(i = 0; i<n;i++)
    {
        cin>>h[i];
        sum+=h[i];
    }
    t=sum/n*a;
    
    for(i=0; i<n; i++)
    {
        h[n]=h[n]-t*b;
    }
    int ans=0;
    ans+t;
    sum=1;
    while(sum>0){
        sum=0;
        ans++;
       
        max_mon=max_num(h, n);
        for(i=0;i<n;i++)
        {
            if(i==max_mon){
                h[i]=h[i]-a;
                if(h[i]>0)
                {
                    sum=sum+1;
                }
            }
            else{
                h[i]=h[i]-b;
                if(h[i]>0){
                    sum=sum+1;
                }
            }
        }
    }
    cout<<ans<<"\n";
    
    return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:71:14: error: expected '}' at end of input
   71 |     return 0;
      |              ^
a.cc:24:1: note: to match this '{'
   24 | {
      | ^
Language: C

#include <stdio.h>
int main(void)
{
  int n, a, b, c, h[100005], h2;
  int mid, low, high, flg, max, x, x2, i;
  scanf("%d %d %d", &n, &a, &b);

  c = a-b;
  max = -1;
  for(i = 0; i < n; i++){
    scanf("%d", &h[i]);
    if(max < h[i]) max = h[i];
  }
  low = 1;
  high = max/b+1;  
  while(low <= high){
    mid = (low + high)/2; 
    flg = 1;
    x = mid;
    for(i = 0; i < n; i++){
      h2 = h[i]-b*mid;
      if(h2 > 0){
	x2 = h2/c; 
	if(h2%c != 0) x2++;
	x -= x2;　　　　
	if(x<0){   
	  flg = 0;
	  break;
	}
      }
    }
    
    if(flag != 1) low = mid+1; 
    　　　else high = mid-1;　　
  }
  printf("%d\n", low);
  return 0;
} 

Compiler output:
main.c: In function 'main':
main.c:25:17: error: stray '\343' in program
   25 |         x -= x2;<U+3000><U+3000><U+3000><U+3000>
      |                 ^~~~~~~~
main.c:25:19: error: stray '\343' in program
   25 |         x -= x2;<U+3000><U+3000><U+3000><U+3000>
      |                         ^~~~~~~~
main.c:25:21: error: stray '\343' in program
   25 |         x -= x2;<U+3000><U+3000><U+3000><U+3000>
      |                                 ^~~~~~~~
main.c:25:23: error: stray '\343' in program
   25 |         x -= x2;<U+3000><U+3000><U+3000><U+3000>
      |                                         ^~~~~~~~
main.c:33:8: error: 'flag' undeclared (first use in this function); did you mean 'flg'?
   33 |     if(flag != 1) low = mid+1;
      |        ^~~~
      |        flg
main.c:33:8: note: each undeclared identifier is reported only once for each function it appears in
main.c:34:5: error: stray '\343' in program
   34 |     <U+3000><U+3000><U+3000>else high = mid-1;<U+3000><U+3000>
      |     ^~~~~~~~
main.c:34:7: error: stray '\343' in program
   34 |     <U+3000><U+3000><U+3000>else high = mid-1;<U+3000><U+3000>
      |             ^~~~~~~~
main.c:34:9: error: stray '\343' in program
   34 |     <U+3000><U+3000><U+3000>else high = mid-1;<U+3000><U+3000>
      |                     ^~~~~~~~
main.c:34:29: error: stray '\343' in program
   34 |     <U+3000><U+3000><U+3000>else high = mid-1;<U+3000><U+3000>
      |                                               ^~~~~~~~
main.c:34:31: error: stray '\343' in program
   34 |     <U+3000><U+3000><U+3000>else high = mid-1;<U+3000><U+3000>
      |                                                       ^~~~~~~~
Language: C

#include <stdio.h>
int main(void)
{
  int n, a, b, c, h[100005], h2;
  int mid, low, high, flg, max, x, x2, i;
  scanf("%d %d %d", &n, &a, &b);

  c = a-b;
  max = -1;
  for(i = 0; i < n; i++){
    scanf("%d", &h[i]);
    if(max < h[i]) max = h[i];
  }
  low = 1;
  high = max/b+1;  
  while(low <= high){
    mid = (low + high)/2; 
    flg = 1;
    x = mid;
    for(i = 0; i < n; i++){
      h2 = h[i]-b*mid;
      if(h2 > 0){
	x2 = h2/c;  
	if(h2%c != 0) x2++;
	x -= x2;　　　　
	if(x<0){   
	  flg = 0;
	  break;
	}
      }
    }

    if(flag != 1) low = mid+1; 
    　　　else high = mid-1;　　
  }
  printf("%d\n", low);
  return 0;
} 

Compiler output:
main.c: In function 'main':
main.c:25:17: error: stray '\343' in program
   25 |         x -= x2;<U+3000><U+3000><U+3000><U+3000>
      |                 ^~~~~~~~
main.c:25:19: error: stray '\343' in program
   25 |         x -= x2;<U+3000><U+3000><U+3000><U+3000>
      |                         ^~~~~~~~
main.c:25:21: error: stray '\343' in program
   25 |         x -= x2;<U+3000><U+3000><U+3000><U+3000>
      |                                 ^~~~~~~~
main.c:25:23: error: stray '\343' in program
   25 |         x -= x2;<U+3000><U+3000><U+3000><U+3000>
      |                                         ^~~~~~~~
main.c:33:8: error: 'flag' undeclared (first use in this function); did you mean 'flg'?
   33 |     if(flag != 1) low = mid+1;
      |        ^~~~
      |        flg
main.c:33:8: note: each undeclared identifier is reported only once for each function it appears in
main.c:34:5: error: stray '\343' in program
   34 |     <U+3000><U+3000><U+3000>else high = mid-1;<U+3000><U+3000>
      |     ^~~~~~~~
main.c:34:7: error: stray '\343' in program
   34 |     <U+3000><U+3000><U+3000>else high = mid-1;<U+3000><U+3000>
      |             ^~~~~~~~
main.c:34:9: error: stray '\343' in program
   34 |     <U+3000><U+3000><U+3000>else high = mid-1;<U+3000><U+3000>
      |                     ^~~~~~~~
main.c:34:29: error: stray '\343' in program
   34 |     <U+3000><U+3000><U+3000>else high = mid-1;<U+3000><U+3000>
      |                                               ^~~~~~~~
main.c:34:31: error: stray '\343' in program
   34 |     <U+3000><U+3000><U+3000>else high = mid-1;<U+3000><U+3000>
      |                                                       ^~~~~~~~
Language: C++

#include <bits/stdc++.h>
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define SORTR(v,n) sort(v, v+n, greater<int>());
// #define int long long    // %d=>%lld
#define pb push_back
#define INF 1000000000
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pii> piii;
typedef pair<ll, pll> plll;

const int MAX_n = 100000;
int n,h;
int a;
int b;


bool solve(int mid){
    int sum=0;
    while(int x:h){
        if(x-mid*b>0){
            sum+=(x-mid*b+(a-b-1))/(a-b);
        }
    }
    if(sum<=mid)
        return true;
    else {
        return false;
    }
}



signed main(){
    scanf("%d", &n);

    scanf("%d", &a);
    scanf("%d", &b);

    vector<int> remains;

    for(int i = 0;i < n;i++){
        scanf("%d", &h);
        remains.pb(h);
    }



    int ok=0;
    int ng=INF; 

    while (abs(ok-ng)>1){
        int mid = (ok+ng)/2;
        if(solve(mid)){
            ok=mid;
        }else{
            ng = mid;
        }
    }

    printf("%d\n", ok);

    return 0;
}

Compiler output:
a.cc: In function 'bool solve(int)':
a.cc:24:16: error: found ':' in nested-name-specifier, expected '::'
   24 |     while(int x:h){
      |                ^
      |                ::
a.cc:24:15: error: 'x' has not been declared
   24 |     while(int x:h){
      |               ^
a.cc:24:18: error: qualified-id in declaration before ')' token
   24 |     while(int x:h){
      |                  ^
a.cc:25:12: error: 'x' was not declared in this scope
   25 |         if(x-mid*b>0){
      |            ^
Language: C++

#include <bits/stdc++.h>
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define SORTR(v,n) sort(v, v+n, greater<int>());
// #define int long long    // %d=>%lld
#define pb push_back
#define INF 1000000000
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pii> piii;
typedef pair<ll, pll> plll;

const int MAX_n = 100000;
int n,h;
int a;
int b;


bool solve(int mid){
    int sum=0;
    while(x:h){
        if(x-mid*b>0){
            sum+=(x-mid*b+(a-b-1))/(a-b);
        }
    }
    if(sum<=mid)
        return true;
    else {
        return false;
    }
}



signed main(){
    scanf("%d", &n);

    scanf("%d", &a);
    scanf("%d", &b);

    vector<int> remains;

    for(int i = 0;i < n;i++){
        scanf("%d", &h);
        remains.pb(h);
    }



    int ok=0;
    int ng=INF; 

    while (abs(ok-ng)>1){
        int mid = (ok+ng)/2;
        if(solve(mid)){
            ok=mid;
        }else{
            ng = mid;
        }
    }

    printf("%d\n", ok);

    return 0;
}

Compiler output:
a.cc: In function 'bool solve(int)':
a.cc:24:12: error: found ':' in nested-name-specifier, expected '::'
   24 |     while(x:h){
      |            ^
      |            ::
a.cc:24:11: error: 'x' has not been declared
   24 |     while(x:h){
      |           ^
a.cc:25:12: error: 'x' was not declared in this scope
   25 |         if(x-mid*b>0){
      |            ^
Language: C++

#include <bits/stdc++.h>
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define SORTR(v,n) sort(v, v+n, greater<int>());
// #define int long long    // %d=>%lld
#define pb push_back
#define INF 1000000000
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pii> piii;
typedef pair<ll, pll> plll;

const int MAX_n = 100000;
int n,h;
int a;
int b;


bool solve(mid){
    int sum=0;
    while(x:h){
        if(x-mid*b>0){
            sum+=(x-mid*b+(a-b-1))/(a-b);
        }
    }
    if(sum<=mid)
        return true;
    else {
        return false;
    }
}



signed main(){
    scanf("%d", &n);

    scanf("%d", &a);
    scanf("%d", &b);

    vector<int> remains;

    for(int i = 0;i < n;i++){
        scanf("%d", &h);
        remains.pb(h);
    }



    int ok=0;
    int ng=INF; 

    while (abs(ok-ng)>1){
        int mid = (ok+ng)/2;
        if(solve(mid)){
            ok=mid;
        }else{
            ng = mid;
        }
    }

    printf("%d\n", ok);

    return 0;
}

Compiler output:
a.cc:22:12: error: 'mid' was not declared in this scope
   22 | bool solve(mid){
      |            ^~~
a.cc: In function 'int main()':
a.cc:58:17: error: 'solve' cannot be used as a function
   58 |         if(solve(mid)){
      |            ~~~~~^~~~~
Language: C++

#include <bits/stdc++.h>
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define SORTR(v,n) sort(v, v+n, greater<int>());
// #define int long long    // %d=>%lld
#define pb push_back
#define INF 1000000000
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pii> piii;
typedef pair<ll, pll> plll;

const int MAX_n = 100000;
int n,h;
int a;
int b;


bool solve(mid){
    int sum=0;
    while(x:h){
        if(x-mid*b>0){
            sum+=(x-mid*b+(a-b-1))/(a-b)
        }
    }
    if(sum<=mid)
        return true;
    else {
        return false;
    }
}



signed main(){
    scanf("%d", &n);

    scanf("%d", &a);
    scanf("%d", &b);

    vector<int> remains;

    for(int i = 0;i < n;i++){
        scanf("%d", &h);
        remains.pb(h);
    }


    // 最大・最小共に使える．okが答え．
    int ok=0;   // 解が存在する値
    int ng=INF;    // 解が存在しない値

    while (abs(ok-ng)>1){
        int mid = (ok+ng)/2;
        if(solve(mid)){
            ok=mid;
        }else{
            ng = mid;
        }
    }

    printf("%d\n", ok);

    return 0;
}

Compiler output:
a.cc:22:12: error: 'mid' was not declared in this scope
   22 | bool solve(mid){
      |            ^~~
a.cc: In function 'int main()':
a.cc:58:17: error: 'solve' cannot be used as a function
   58 |         if(solve(mid)){
      |            ~~~~~^~~~~
Language: C

#include<stdio.h>

int main(void){
  long long int N,A,B;
  long long int i;
  long long int h[100000];
  long long int K;
  long long int left,right;
  long long int sum;

  scanf("%d %d %d",&N,&A,&B);

  for(i=0;i<N;i++){
    scanf("%d",&h[i]);
  }

  left=0;
  right=1000000000;
  K=(right+left)/2

  while(1){

    sum=0;
    for(i=0;i<N;i++){
      if(h[i]-K*B > 0){
        sum += (h[i]-B*K)%(A-B) ? (h[i]-B*K)/(A-B)+1 : (h[i]-B*K)/(A-B);
      }
    }

    if(sum<=K){
      right=(right+left)/(long long int)2;
    }else{
      left=(right+left)/(long long int)2;
    }

    K=(right+left)/2;

    if(left==right-1){
      break;
    }
  }

  printf("%d\n", right);

  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:19:19: error: expected ';' before 'while'
   19 |   K=(right+left)/2
      |                   ^
      |                   ;
   20 | 
   21 |   while(1){
      |   ~~~~~
Language: C

#include<stdio.h>
#include<math.h>

int main(void){
  long long N,A,B;
  long long i,max;
  long long h[100000];
  long long K;
  long long left,right;
  long long sum;

  scanf("%d %d %d",&N,&A,&B);

  /*N=5;
  A=2;
  B=1;
  max=0;*/

  for(i=0;i<N;i++){
    scanf("%10d",&h[i]);
    if(h[i]>max){
      max=h[i];
    }
  }

  /*h[0]=900000000;
  h[1]=900000000;
  h[2]=1000000000;
  h[3]=1000000000;
  h[4]=1000000000;*/

  left=0;
  right=1000000000;

  while(left!=right){
    K=(right+left)/2;
    sum=0;
    for(i=0;i<N;i++){
      if(h[i]-K*B>=0){
        sum += h[i]%(A-B) ? (h[i]-B*K)/(A-B)+1 : (h[i]-B*K)/(A-B);
        }
      }
    }
    // printf("sum=%llu\n",sum);
    if(sum<=K){
      right=K;
    }else{
      left=K+1;
    }
    // printf("left=%llu,right=%llu\n",left,right);
  }

  printf("%llu\n", left);

  return 0;
}


Compiler output:
main.c:53:10: error: expected declaration specifiers or '...' before string constant
   53 |   printf("%llu\n", left);
      |          ^~~~~~~~
main.c:53:20: error: unknown type name 'left'
   53 |   printf("%llu\n", left);
      |                    ^~~~
main.c:55:3: error: expected identifier or '(' before 'return'
   55 |   return 0;
      |   ^~~~~~
main.c:56:1: error: expected identifier or '(' before '}' token
   56 | }
      | ^
Language: Java

import java.util.Scanner;

public class D {

	public static void main(String[] args) {
		Scanner stdin = new Scanner(System.in);
		int n , k = 0;
		long a, b;
		n = stdin.nextInt();
		a = stdin.nextLong();
		b = stdin.nextLong();
		long[] A = new long[n];
		for (int i = 0; i < n; i++) {
			A[i] = stdin.nextInt();
		}
		long Tmax=1000000000;
		long Tmin=0;
		long T=0;
		//二分探索
		while(Tmax-Tmin>1){
			T=Tmin+(Tmax-Tmin)/2;
			 k=0;
			for(int i=0;i<n;i++){
				//何回爆発すれば全員殺せるかカウントする
				if(A[i]>b*T){
					k+=Math.ceil((double)(A[i]-b*T)/(double)(a-b));
				}
			}
			
			if(k>T){
				Tmin=T;
			}
			else if(k<=T){
				Tmax=T;
			}
		}
		System.out.println(Tmax);
	}

}

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

import java.util.Scanner;

public class D {

	public static void main(String[] args) {
		Scanner stdin = new Scanner(System.in);
		int n , k = 0;
		int a, b, x = 0;
		n = stdin.nextInt();
		a = stdin.nextInt();
		b = stdin.nextInt();
		long[] A = new long[n];
		for (int i = 0; i < n; i++) {
			A[i] = stdin.nextInt();
		}
		int Tmax=1000000000;
		int Tmin=0;
		int T=0;
		//二分探索
		while(Tmax-Tmin>1){
			T=Tmin+(Tmax-Tmin)/2;
			 k=0;
			for(int i=0;i<n;i++){
				if(A[i]>b*T){
					k+=Math.ceil((double)(A[i]-b*T)/(double)(a-b));
				}
			}
			
			if(k>T){
				Tmin=T;
			}
			else if(k<=T){
				Tmax=T;
			}
		}
		System.out.println(Tmax);
	}

}

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

#include <iostream>
#include <queue>

bool check_knock(std::vector<int> hp, int a, int b, int search_num) {
    int less = hp[hp.size() - 1]; 
    int div = a - b;
    int total = 0;

    for (int i = 0; i < hp.size(); i++) {
        hp[i] -= search_num * b;
        if (hp[i] > 0) {
            total += (hp[i] / div); 
            if (hp[i] % div != 0) {
                total++;
            }
        }
    }
    if (total > search_num) {
        return false;
    } else {
        return true;
    }
}

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

    std::vector<int> hp(n);
    for (int i = 0; i < n; i++) {
        std::cin >> hp[i]; 
    }
    std::sort(hp.begin(), hp.end(), std::greater<int>());

    int left;
    int right;
    int middle;
    left = 0;
    right = 1e09;
    while (left < right) {
        middle = (left + right) / 2;
        if (check_knock(hp, a, b, middle) == false) {
            left = middle + 1;
        } else {
            right = middle;
        }
    }
    std::cout << middle << std::endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   35 |     std::sort(hp.begin(), hp.end(), std::greater<int>());
      |          ^~~~
      |          qsort
Language: C++

#include <limits>
#include <bits/stdc++.h>
using namespace std;
bool vis[10005]={false};
int a[100005],n;

int main()
{
	long long int int i,sum=0,c,b,x;
	cin>>n>>c>>b;
	x  =c-b;
	for(i=0;i<n;i++)
        {cin>>a[i];
        }

      long long int moves =1000000000000000,temp;
    long long  int high,low,mid;
      high = 100000000000000;
      low = 1;

      while(high>low)
      {temp=0;
          mid = (high+low)/2;

          for(i=0;i<n;i++)
          {
              if(a[i]-mid*b>0)
              {
                  temp += (a[i]-mid*b+x-1)/x;
              }

          }
          if(temp<=mid)
          {
              moves = min(moves,mid);
              high = mid;
          }
          else
            low = mid+1;
      }
      cout<<low;

return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:19: error: two or more data types in declaration of 'i'
    9 |         long long int int i,sum=0,c,b,x;
      |                   ^~~
a.cc:9:19: error: two or more data types in declaration of 'sum'
a.cc:9:19: error: two or more data types in declaration of 'c'
a.cc:9:19: error: two or more data types in declaration of 'b'
a.cc:9:19: error: two or more data types in declaration of 'x'
a.cc:10:17: error: 'c' was not declared in this scope
   10 |         cin>>n>>c>>b;
      |                 ^
a.cc:10:20: error: 'b' was not declared in this scope
   10 |         cin>>n>>c>>b;
      |                    ^
a.cc:11:9: error: 'x' was not declared in this scope
   11 |         x  =c-b;
      |         ^
a.cc:12:13: error: 'i' was not declared in this scope
   12 |         for(i=0;i<n;i++)
      |             ^
a.cc:25:15: error: 'i' was not declared in this scope
   25 |           for(i=0;i<n;i++)
      |               ^
Language: C++

#include <algorithm>
#include <iomanip>
#include <istream>
#include <map>
#include <numeric>
#include <ostream>
#include <set>
#include <sstream>
#include <string>
#include <utility>
#include <vector>
#include <queue>
using namespace std;


class Solution {
public:
    int n, a, b;
    vector<int> h;

    bool enough(int t)
    {
        bool ret = true;

        int sum = 0;
        for (int i = 0; i < n; i++)
        {
            sum += ceil((h[i] - b * t) / (double)(a - b));
        }

        if (sum <= t)
        {
            ret = true;
        }
        else
        {
            ret = false;
        }

        return ret;
    }

    void solve(std::istream& in, std::ostream& out) {
        in >> n >> a >> b;
        for (int i = 0; i < n; i++)
        {
            int tmp;
            in >> tmp;
            h.push_back(tmp);
        }

        int l,c,r;
        l = 1;
        r = (int)10e9;
        while (l < r)
        {
            c = (l + r) / 2;

            if (enough(c))
            {
                r = c;
            }
            else
            {
                l = c + 1;
            }
        }
        c = (l + r) / 2;

        out << c;
    }
};

void solve(std::istream& in, std::ostream& out)
{
    out << std::setprecision(12);
    Solution solution;
    solution.solve(in, out);
}


#include <fstream>
#include <iostream>


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


    istream& in = cin;


    ostream& out = cout;

    solve(in, out);
    return 0;
}




Compiler output:
a.cc: In member function 'bool Solution::enough(int)':
a.cc:28:20: error: 'ceil' was not declared in this scope
   28 |             sum += ceil((h[i] - b * t) / (double)(a - b));
      |                    ^~~~
Language: C++

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

#define REP(i,n) for (int i=0;i<(n);i++)
#define PII pair<int,int>
#define LL long long

  LL n,a,b;
  LL h[100010];
  LL sum=0;

  bool check(LL t){
    LL cnt=0;
    LL base = t*b;
    REP(i,n){
      LL r=h[i]-base;
      cnt+=r/(a-b) + (r%(a-b)!=0);
    }
    if(cnt>t){
      return false;
    }else{
      return true;
    }
  }

  int nibutan(LL left,LL right){
    while(left<right){
      LL mid = (left + right)/2;
      if(check(mid)){
        right=mid;
      }else{
        left=mid+1;
      }
    }

    return right;
  }

int main(){
  
  cin>>n>>a>>b;
  REP(i,n){
    cin>>h[i];
  }
  sort(h,h+n);
 
  cout<<nibutan(1,INT_MAX)<<endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:51:19: error: 'INT_MAX' was not declared in this scope
   51 |   cout<<nibutan(1,INT_MAX)<<endl;
      |                   ^~~~~~~
a.cc:6:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    5 | #include <math.h>
  +++ |+#include <climits>
    6 | using namespace std;
Language: C++

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

int n, a, b;
ll h[100000], h2[100000], hmax = 0;

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

	int left = 1, right = hmax, mid;
	while (right != left+1) {
		mid = (left + right) / 2;
		for (int i = 0; i < n; i++)h2[i] = h[i] - mid*b;

		ll sum = 0;
		for (int i = 0; i < n; i++) {
			if (h2[i] > 0) {
				sum += ceil(h2[i] / (a - b));
			}
		}

		if (sum > mid) {
			left = mid;
		}
		else {
			right = mid;
		}
	}

	cout << right << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:40: error: 'ceil' was not declared in this scope
   24 |                                 sum += ceil(h2[i] / (a - b));
      |                                        ^~~~
Language: C++

#include <cstdio>
#include <stdio.h>
#include <string>
#include <string.h>
#include <algorithm>
#include <vector>
#include <iostream>
#include <stdlib.h>
#include <math.h>
using namespace std;

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
long N,A,B;
long out = 0;
long C;
long h[1000000];
long x[1000000];
long tem;


bool q(long k){

	long t = 0;
	REP(N){
		t += ceil((double)(h[i]-(k*B))/C );
	}
	if(t<=k){
		return true;
	}
	else{
		return false;
	}

}


int main(){
	
	cin >> N >> A >> B;
	C = A - B;

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

	long long max = 1000000000;//10^9
	long long min = 0;
	long long mid;
	//にぶたん
	while(max-min>1){
		mid = (max + min)/2;
		if(q(mid)){
			max = mid;
		}
		else{
			min = mid++;
		}
	}

	mid -=10;
	while(!q(mid)){
		q++;
	}
	
	cout << mid << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:66:17: warning: ISO C++ forbids incrementing a pointer of type 'bool (*)(long int)' [-Wpointer-arith]
   66 |                 q++;
      |                 ^
a.cc:66:18: error: lvalue required as increment operand
   66 |                 q++;
      |                  ^~
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long A = sc.nextLong();
		long B = sc.nextLong();
		
		long h[] = new long[N];
		
		for(int i=0; i<N; i++){
			h[i]=sc.nextLong();
		}
		
		long fin;
		fin = Long.MAX_VALUE/B;
		long answer = binarytree(0,fin,A,B,N,h);
		System.out.println(answer);
	}
	
	public static long binarytree(long startrange, long endrange, long A,long B,int N,long h[]){
		if(startrange>endrange) return startrange;
		long mid = (startrange+endrange)/2;
		if(kansuu(mid,A,B,N,h)){
			return binarytree(startrange,mid-1,A,B,N,h);
		}
		else{
			return binarytree(mid+1,endrange,A,B,N,h);
		}
	}
	public static boolean kansuu(long T,long A,long B,int N,long h[]){
		double times=0;
		for(int i=0; i<N; i++){
			for(int k=0; k<T; k++){
				double U =(double)(h[i]-B*T);
			double K = U/(double)(A-B);
			double Y = Math.ceil(K);
			if(Y>0){
				times = times + Y;
			}
		}
		if(times<=T) return true;
		else return false;
	}
}

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

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long A = sc.nextLong();
		long B = sc.nextLong();
		
		long h[] = new long[N];
		
		for(int i=0; i<N; i++){
			h[i]=sc.nextLong();
		}
		
		long answer = binarytree(0,Long.MAX_VALUE,A,B,N,h);
		System.out.println(answer);
	}
	
	public static long binarytree(long startrange, long endrange, long A,long B,int N,long h[]){
		if(startrange>endrange) return startrange;
		long mid = (startrange+endrange)/2;
		if(kansuu(mid,A,B,N,h)){
			return binarytree(startrange,mid-1,A,B,N,h);
		}
		else{
			return binarytree(mid+1,endrange,A,B,N,h);
		}
	}
	public static boolean kansuu(long T,long A,long B,int N,long h[]){
		long times=0;
		for(int i=0; i<N; i++){
			double U =((double)(h[i]-B*T))/((double)(A-B));
			double Y = Math.ceil(U);
			if(Y>0){
				times = times + Y;
			}
		}
		if(times<=T) return true;
		else return false;
	}
}

Compiler output:
Main.java:35: error: incompatible types: possible lossy conversion from double to long
				times = times + Y;
				              ^
1 error
Language: C++

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

typedef long long ll;
ll h[100005];
ll n,a,b;

bool check(ll k){
    ll cnt = k*b;
    int num = upper_bound(h+1,h+1+n,cnt) - h;
    ll sum = 0;
    for(int i = num;i <= n;i++)
    {
        //printf("h[i]=%lld\n",h[i]);
        ll tmp = h[i] - cnt;
        sum += (tmp+a-b-1) / (a-b);
        //tmp/(a-b)+bool(tmp%(a-b));
    }
    //printf("%lld %lld\n",sum,k);
    return sum <= k;
}
int main(){
    scanf("%lld%lld%lld",&n,&a,&b);
    for(int i = 1;i <= n;i++)
        scanf("%lld",&h[i]);

    sort(h+1,h+1+n);
    ll l = 0,r = INT_MAX,mid;
    while(l < r){
        mid = (l+r)/2;
        if(!check(mid))
            l = mid+1;
        else
            r = mid;
    }
    printf("%lld\n",r);
    return 0;
}
//2 3   2 3  1 2  1 1       5 5 3 5


Compiler output:
a.cc: In function 'int main()':
a.cc:30:18: error: 'INT_MAX' was not declared in this scope
   30 |     ll l = 0,r = INT_MAX,mid;
      |                  ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include<cstring>
  +++ |+#include <climits>
    4 | using namespace std;
a.cc:32:9: error: 'mid' was not declared in this scope
   32 |         mid = (l+r)/2;
      |         ^~~
Language: C++

#include<cstdio>
#include<algorithm>
using namespace std;

typedef long long ll;
ll h[100005];
ll n,a,b;

bool check(ll k){
    ll cnt = k*b;
    int num = upper_bound(h+1,h+1+n,cnt) - h;
    ll sum = 0;
    for(int i = num;i <= n;i++)
    {
        //printf("h[i]=%lld\n",h[i]);
        ll tmp = h[i] - cnt;
        sum += (tmp+a-b-1) / (a-b);
        //tmp/(a-b)+bool(tmp%(a-b));
    }
    //printf("%lld %lld\n",sum,k);
    return sum <= k;
}
int main(){
    scanf("%lld%lld%lld",&n,&a,&b);
    for(int i = 1;i <= n;i++)
        scanf("%lld",&h[i]);

    sort(h+1,h+1+n);
    ll l = 0,r = INT_MAX,mid;
    while(l < r){
        mid = (l+r)/2;
        if(!check(mid))
            l = mid+1;
        else
            r = mid;
    }
    printf("%lld\n",r);
    return 0;
}
//2 3   2 3  1 2  1 1       5 5 3 5


Compiler output:
a.cc: In function 'int main()':
a.cc:29:18: error: 'INT_MAX' was not declared in this scope
   29 |     ll l = 0,r = INT_MAX,mid;
      |                  ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include<algorithm>
  +++ |+#include <climits>
    3 | using namespace std;
a.cc:31:9: error: 'mid' was not declared in this scope
   31 |         mid = (l+r)/2;
      |         ^~~
Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
typedef long long ll;
ll h[100005];
ll n,a,b;

bool check(ll k){
    ll cnt = k*b;
    int num = upper_bound(h+1,h+1+n,cnt) - h;
    ll sum = 0;
    for(int i = num;i <= n;i++)
    {
        //printf("h[i]=%lld\n",h[i]);
        ll tmp = h[i] - cnt;
        sum += (tmp+a-b-1) / (a-b);
        //tmp/(a-b)+bool(tmp%(a-b));
    }
    //printf("%lld %lld\n",sum,k);
    return sum <= k;
}
int main(){
    scanf("%lld%lld%lld",&n,&a,&b);
    for(int i = 1;i <= n;i++)
        scanf("%lld",&h[i]);

    sort(h+1,h+1+n);
    ll l = 0,r = INT_MAX,mid;
    while(l < r){
        mid = (l+r)/2;
        if(!check(mid))
            l = mid+1;
        else
            r = mid;
    }
    printf("%lld\n",r);
    return 0;
}
//2 3   2 3  1 2  1 1       5 5 3 5


Compiler output:
a.cc: In function 'int main()':
a.cc:29:18: error: 'INT_MAX' was not declared in this scope
   29 |     ll l = 0,r = INT_MAX,mid;
      |                  ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include<algorithm>
  +++ |+#include <climits>
    4 | using namespace std;
a.cc:31:9: error: 'mid' was not declared in this scope
   31 |         mid = (l+r)/2;
      |         ^~~
Language: C++

#include <cstdio>
#include <vector>
#include <stdlib.h>
#include <algorithm>
#include <functional>
using namespace std;

int main()
{
	long n, a, b;
	scanf("%ld", &n);
	scanf("%ld", &a);
	scanf("%ld", &b);
	vector<long> v;
	vector<long> w;
	for (int i = 0; i < n; i++)
	{
		scanf("%ld", &v[i]);
	}
	sort(v.begin(), v.end(), greater<long>());

	long l = 0;
	long r = v[0]/b;
	long m,count;
	bool flag = false;
	while (l != r)
	{
		flag = false;
		m = (l + r) / 2;
		count = m;
		copy(v.begin(), v.end(), w.begin());
		for (int i = 0; i < n; i++)
		{
			w[i] -= b*m;
			if (w[i] <= 0)
			{
				flag = true;
				break;
			}
			count -= ceil((double)(w[i])/(a-b));
			if (count < 0) break;
			if (i == n - 1)
			{
				flag = true;
			}
		}
		if (flag)
		{
			r = m;
		}
		else
		{
			l = m + 1;
		}
	}
	printf("%ld\n", l);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:34: error: 'ceil' was not declared in this scope
   40 |                         count -= ceil((double)(w[i])/(a-b));
      |                                  ^~~~