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

#include <cassert>
#include <cstdio>
#include <cmath>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>

using namespace std;
using lint = long long;
constexpr int MOD = 1000000007, INF = 1111111111;

template <class T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
	for (const auto &e : vec) os << e << (&e == &vec.back() ? "" : " ");
	return os;
}

template <class T1, class T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) {
	os << p.first << " " << p.second;
	return os;
}

template <class T1, class T2>
ostream &operator<<(ostream &os, const map<T1, T2> &mp) {
	for (const auto &e : mp) os << "[" << e << "] ";
	return os;
}

#ifdef _DEBUG
template <class Head>
void dump(const char* str, Head &&h) { cerr << str << " = " << h << "\n"; };
template <class Head, class... Tail>
void dump(const char* str, Head &&h, Tail &&... t) {
	while (*str != ',') cerr << *str++; cerr << " = " << h << "\n";
	dump(str + (*(str + 1) == ' ' ? 2 : 1), t...);
}
#define DMP(...) dump(#__VA_ARGS__, __VA_ARGS__)
#else 
#define DMP(...) ((void)0)
#endif

int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	lint N, A, B;
	cin >> N >> A >> B;

	vector<lint> h(N);
	for (int i = 0; i < N; i++) cin >> h[i];
	sort(h.begin(), h.end());

	auto biSearch = [&](auto &f) {
		lint ng = -1;
		lint ok = h.back();

		while (abs(ok - ng) > 1) {
			lint mid = (ok + ng) / 2;

			if (f(mid)) ok = mid;
			else ng = mid;
		}

		return ok;
	};

	auto judge = [&](int &idx) {

		lint ex = 0;
		for (int i = 0; i < N; i++) {
			if (h[i] - B * idx > 0) ex += (h[i] - B * idx - 1) / (A - B) + 1;
			DMP(ex);
		}

		DMP(idx, ex);
		return ex <= idx;

	};

	cout << biSearch(judge) << "\n";

	return 0;
}


Compiler output:
a.cc: In instantiation of 'main()::<lambda(auto:1&)> [with auto:1 = main()::<lambda(int&)>]':
a.cc:86:18:   required from here
   86 |         cout << biSearch(judge) << "\n";
      |                 ~~~~~~~~^~~~~~~
a.cc:66:30: error: no match for call to '(main()::<lambda(int&)>) (lint&)'
   66 |                         if (f(mid)) ok = mid;
      |                             ~^~~~~
a.cc:73:22: note: candidate: 'main()::<lambda(int&)>' (near match)
   73 |         auto judge = [&](int &idx) {
      |                      ^
a.cc:73:22: note:   conversion of argument 1 would be ill-formed:
a.cc:66:31: error: cannot bind non-const lvalue reference of type 'int&' to a value of type 'lint' {aka 'long long int'}
   66 |                         if (f(mid)) ok = mid;
      |                               ^~~
Language: C++

#include<iostream>
#include<string>
#include<cstdio>
#include <cstring>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 1000000007;
typedef long double ld;
const ll INF = 1e+14;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back

void Yes(){
	cout<<"Yes"<<endl;
	exit(0);
}
 
void No(){
	cout<<"No"<<endl;
	exit(0);
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
    int N, A, B; cin >> N >> A >> B;
    A -= B;
    //魔物を倒す順は関係ない
    priority_queue<int> pque;
    rep(i, N) {
        int h; cin >> h;
        pque.push(h);
    }
    int a = que.top(); que.pop();
    int b = que.top(); que.pop();
    int cnt = 1;
    while(a > A + B * cnt || b > B * cnt) {
        cnt ++;
        a -= A;
        que.push(a); que.push(b);
        a = que.top(); que.pop();
        b = que.top(); que.pop();
    }
    cout << cnt - 1 << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:65:13: error: 'que' was not declared in this scope; did you mean 'pque'?
   65 |     int a = que.top(); que.pop();
      |             ^~~
      |             pque
Language: C++

#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <climits>
#include <numeric>
#include <cmath>
#include <queue>
#include <sstream>
#include <string.h>
#include <bitset>

using namespace std;
typedef long long ll;

vector<ll> list;
ll N, A, B;

bool isOK(ll x) {
  ll num = 0;
  for (int i = 0; i < N; i++) {
    ll hp = list[i] - (x * B);
    if (hp > 0) {
      ll cnt = hp / (A - B);
      if (hp % (A - B)) {
        cnt++;
      }
    }
    num += cnt;
  }
  return x >= num;
}

ll binary_search() {
  ll left = -1;
  ll right = 1e9 + 10;
  
  while (right - left > 1) {
    ll mid = left + (right - left) / 2;
    
    if (isOK(mid)) right = mid;
    else left = mid;
  }
  return right;
}

int main() {
  cin >> N >> A >> B;
  list.resize(N);
  for (int i = 0; i < N; i++) {
    cin >> list[i];
  }
  cout << binary_search() << endl;
  return 0;
}


Compiler output:
a.cc: In function 'bool isOK(ll)':
a.cc:31:12: error: 'cnt' was not declared in this scope; did you mean 'int'?
   31 |     num += cnt;
      |            ^~~
      |            int
Language: C++

int n ,a ,b ,h ,cnt ;
priority_queue<int> pq ;
int main(){
    scanf("%d%d%d",&n,&a,&b) ;
    a -= b ;
    while(n--){
        scanf("%d",&h);
        pq.push(h);
    }
    while(pq.top() - 1ll*b*cnt>0){
        pq.push(pq.top()-a);
        pq.pop();
        ++cnt ;
    }
    printf("%d",cnt);
    return 0 ;
}

Compiler output:
a.cc:2:1: error: 'priority_queue' does not name a type
    2 | priority_queue<int> pq ;
      | ^~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:4:5: error: 'scanf' was not declared in this scope
    4 |     scanf("%d%d%d",&n,&a,&b) ;
      |     ^~~~~
a.cc:8:9: error: 'pq' was not declared in this scope
    8 |         pq.push(h);
      |         ^~
a.cc:10:11: error: 'pq' was not declared in this scope
   10 |     while(pq.top() - 1ll*b*cnt>0){
      |           ^~
a.cc:15:5: error: 'printf' was not declared in this scope
   15 |     printf("%d",cnt);
      |     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int n ,a ,b ,h ,cnt ;
Language: C++

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

int MAX=100010;
ll N,A,B;
ll h[MAX];

bool enough(ll x){
    ll num=0;
    for(int i=0;i<N;i++){
        num+=(h[i]-B*x+(A-B-1))/(A-B);
    }
    if(num<=x) return true;
    else return false;
}

int main(){
    cin >> N >> A >> B;
    ll mx=0;
    for(int i=0;i<N;i++){
        cin >> h[i];
        mx=max(mx,h[i]);
    }
    ll left=0;
    ll right=mx+1;
    while(right-left>0){
        ll mid=(left+right)/2;
        if(enough(mid)){
            right=mid;
        }else{
            left=mid+1;
        }
    }
    cout << right << endl;
}


Compiler output:
a.cc:8:6: error: size of array 'h' is not an integral constant-expression
    8 | ll h[MAX];
      |      ^~~
Language: C++

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

ll MAX=100010;
ll N,A,B;
ll h[MAX];

bool enough(ll x){
    ll num=0;
    for(int i=0;i<N;i++){
        num+=(h[i]-B*x+(A-B-1))/(A-B);
    }
    if(num<=x) return true;
    else return false;
}

int main(){
    cin >> N >> A >> B;
    ll mx=0;
    for(int i=0;i<N;i++){
        cin >> h[i];
        mx=max(mx,h[i]);
    }
    ll left=0;
    ll right=mx+1;
    while(right-left>0){
        ll mid=(left+right)/2;
        if(enough(mid)){
            right=mid;
        }else{
            left=mid+1;
        }
    }
    cout << right << endl;
}


Compiler output:
a.cc:8:6: error: size of array 'h' is not an integral constant-expression
    8 | ll h[MAX];
      |      ^~~
Language: C++

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

int main() {
  int n,b,a;
  cin >> n >> a >> b;
  int x = 0;
  vector<int> h(n);
  for(int i=0;i<n;i++){
    cin >> h.at(i);
  }
  sort(a.begin(), a.end());
  
  while(a.at(n-1) > 0){
    for(int i=0;i<n-1;i++){
      a.at(i) -= b;
    }
    a.at(n-1) -= a;
    sort(a.begin(), a.end());
    x++;
  }
  
  cout << x << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: request for member 'begin' in 'a', which is of non-class type 'int'
   12 |   sort(a.begin(), a.end());
      |          ^~~~~
a.cc:12:21: error: request for member 'end' in 'a', which is of non-class type 'int'
   12 |   sort(a.begin(), a.end());
      |                     ^~~
a.cc:14:11: error: request for member 'at' in 'a', which is of non-class type 'int'
   14 |   while(a.at(n-1) > 0){
      |           ^~
a.cc:16:9: error: request for member 'at' in 'a', which is of non-class type 'int'
   16 |       a.at(i) -= b;
      |         ^~
a.cc:18:7: error: request for member 'at' in 'a', which is of non-class type 'int'
   18 |     a.at(n-1) -= a;
      |       ^~
a.cc:19:12: error: request for member 'begin' in 'a', which is of non-class type 'int'
   19 |     sort(a.begin(), a.end());
      |            ^~~~~
a.cc:19:23: error: request for member 'end' in 'a', which is of non-class type 'int'
   19 |     sort(a.begin(), a.end());
      |                       ^~~
Language: C++

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

int binary_search(vector<int> &h, long long x){
    int ok = (int)h.size();
    int ng = - 1;
    while (abs(ok - ng) > 1){
        int mid = (ok + ng) / 2;
        if (h[mid] > x) ok = mid;
        else ng = mid;
    }
    return ok;
}

int main(){
    long long n, a, b;
    cin >> n >> a >> b;
    vector<long long> h(n);
    for (int i = 0; i < n; i++) cin >> h[i];
    sort(h.begin(), h.end());
    long long ok = 1'000'000'001;
    long long ng = - 1;
    while (abs(ok - ng) > 1){
        long long mid = (ok + ng) / 2;
        long long tmp = binary_search(h, mid * b);
        long long res = 0;
        for (int i = tmp; i < n; i++){
            res += (h[i] - mid * b + a - b - 1)/(a - b);
        }
        if (res <= mid) ok = mid;
        else ng = mid;
    }
    cout << ok << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:38: error: no matching function for call to 'binary_search(std::vector<long long int>&, long long int)'
   25 |         long long tmp = binary_search(h, mid * b);
      |                         ~~~~~~~~~~~~~^~~~~~~~~~~~
a.cc:4:5: note: candidate: 'int binary_search(std::vector<int>&, long long int)'
    4 | int binary_search(vector<int> &h, long long x){
      |     ^~~~~~~~~~~~~
a.cc:4:32: note:   no known conversion for argument 1 from 'std::vector<long long int>' to 'std::vector<int>&'
    4 | int binary_search(vector<int> &h, long long x){
      |                   ~~~~~~~~~~~~~^
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:2194:5: note: candidate: 'template<class _FIter, class _Tp> bool std::binary_search(_FIter, _FIter, const _Tp&)'
 2194 |     binary_search(_ForwardIterator __first, _ForwardIterator __last,
      |     ^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:2194:5: note:   candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_algo.h:2228:5: note: candidate: 'template<class _FIter, class _Tp, class _Compare> bool std::binary_search(_FIter, _FIter, const _Tp&, _Compare)'
 2228 |     binary_search(_ForwardIterator __first, _ForwardIterator __last,
      |     ^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:2228:5: note:   candidate expects 4 arguments, 2 provided
Language: C++

#include<bits/stdc++.h>
#define ll long long
#define pii pair<int,int> 
#define mp make_pair
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fi first
#define se second
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
int n,a,b;
ll mon[100001];
bool check(int mid){
    ll nowans=0;
    for(int i=0;i<n;i++)
        nowans+=max(0,(mon[i]-b*mid+a-1)/a);
    if(nowans<=mid) return 1;
    return 0;
}
int main(){
    cin>>n>>a>>b;
    a-=b;
    for(int i=0;i<n;i++)
        scanf("%d",&mon[i]);
    ll lb=-1,ub=1.5e9;
    while(lb<=ub){
        ll mid=(lb+ub)/2;
        if(check(mid))
            ub=mid-1;
        else
            lb=mid+1;
    }
    cout<<lb<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'bool check(int)':
a.cc:18:20: error: no matching function for call to 'max(int, long long int)'
   18 |         nowans+=max(0,(mon[i]-b*mid+a-1)/a);
      |                 ~~~^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:18:20: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   18 |         nowans+=max(0,(mon[i]-b*mid+a-1)/a);
      |                 ~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: '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:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:18:20: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   18 |         nowans+=max(0,(mon[i]-b*mid+a-1)/a);
      |                 ~~~^~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include "/Users/daikikodama/Desktop/stdc++.h"
//#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define int long long
#define double long double
#define mod 1000000007
#define F first
#define S second
#define P pair<long long,long long>
#define all(a) a.begin(),a.end()
#define INF 1000000000000000000
#define endl '\n'
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using namespace std;

signed main(void){
    int n,a,b; cin>>n>>a>>b;
    vector<int> h(n);
    rep(i,n)cin>>h.at(i);
    int R=1000000000,L=0;
    while(R-L>1){
        int M=(R+L)/2;
        int cnt=0;
        rep(i,n){
            int tmp=h.at(i)-M*b;
            if(tmp<=0)continue;
            cnt+=(tmp+a-b-1)/(a-b);
        }
        if(cnt>M){
            L=M;
        }else{
            R=M;
        }
    }
    cout<<R<<endl;
}

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

#include "/Users/daikikodama/Desktop/stdc++.h"
//#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define int long long
#define double long double
#define mod 1000000007
#define F first
#define S second
#define P pair<long long,long long>
#define all(a) a.begin(),a.end()
#define INF 1000000000000000000
#define endl '\n'
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using namespace std;

signed main(void){
    int n,a,b; cin>>n>>a>>b;
    vector<int> h(n);
    rep(i,n)cin>>h.at(i);
    int R=INF,L=0;
    while(R-L>1){
        int M=(R+L)/2;
        int cnt=0;
        rep(i,n){
            int tmp=max<int>(0,h.at(i)-M*b);
            cnt+=(tmp+a-b-1)/(a-b);
        }
        if(cnt>M){
            L=M;
        }else{
            R=M;
        }
    }
    cout<<R<<endl;
}

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

#include <bits/stdc++.h>

#define int long long
#define MOD 1000000007
 
using namespace std;

bool enough(int t,int n,int a,int b,int h[]){

    int c = a-b;
    int sum=0;

    for(int i=0;i<n;i++){
        h[i]=h[i]-b*t;
        if(h[i]>0){
            int count = ceil((float)h[i]/c);
            sum = sum +count;
        }

        if(sum>t){
            return false;
        }

    }

    if(sum<=t){
        return true;
    }

}



signed main(){

    int N,A,B;
    cin>> N >> A >> B;
    int h[N];
    for(int i=0;i<N;i++){
        cin >> h[i];
    }

    int min = 1;
    int max = MOD;

    while(1){
        int pos = (min+max)/2;

        if(max-min==1){
           if(enough(min,N,A,B,h)){
               cout <<min<<endl;
               return 0;
           }

            else{
                cout << max <<endl;
                return 0;
            }

        }

        if(enough(pos,A,B,h)){
            max = pos;
        }

        else{
            min = pos;
        }

    }





    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:62:27: error: invalid conversion from 'long long int*' to 'long long int' [-fpermissive]
   62 |         if(enough(pos,A,B,h)){
      |                           ^
      |                           |
      |                           long long int*
a.cc:62:18: error: too few arguments to function 'bool enough(long long int, long long int, long long int, long long int, long long int*)'
   62 |         if(enough(pos,A,B,h)){
      |            ~~~~~~^~~~~~~~~~~
a.cc:8:6: note: declared here
    8 | bool enough(int t,int n,int a,int b,int h[]){
      |      ^~~~~~
a.cc: In function 'bool enough(long long int, long long int, long long int, long long int, long long int*)':
a.cc:30:1: warning: control reaches end of non-void function [-Wreturn-type]
   30 | }
      | ^
Language: C++

#include <iostream>
#include <cmath>
#include <cfenv>
using namespace std;
#define ll long long

int main () {
  ll n, a, b;
  cin >> n >> a >> b;
  ll h[n], sub[n];
  ll max = 0;
  for (ll i = 0; i < n; i++) {
    cin >> h[i];
    max += h[i] / b + 1;  
    sub[i] = h[i];
  }  
  ll left = 0;
  ll right = max + 1;
  while (left < right - 1) {
    double check = (double) mid / 1000000000;
    if (check * b > 1) {
      right = mid;
    }
    ll mid = (left + right) / 2;
    for (ll i = 0; i < n; i++) {
      sub[i] = h[i] - b * mid;  
    }  
    ll num = 0;
    for (ll i = 0; i < n; i++) {
      if (sub[i] > 0) {
        num += ceil((float) sub[i] / (a - b));    
      }  
    }
    if (mid >= num) {
      right = mid;  
    }
    else {
      left = mid;  
    }
  }
  cout << right << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:29: error: 'mid' was not declared in this scope
   20 |     double check = (double) mid / 1000000000;
      |                             ^~~
Language: C++

#include <iostream>
#include <math.h>
#include <algorithm>
#include <set>
#include <map>
#include <string>
using namespace std;
typedef long long ll;
#define rep(i,s,n)for(ll i=s;i<n;i++)
#define repe(i,s,n)for(ll i=s;i<=n;i++)
#define rep_r(i,s,n)for(ll i=n-1;i>=s;i--)
#define repe_r(i,s,n)for(ll i=s;i<=n;i++)
static const ll MOD = 1e9 + 7;
static const ll MAX_L = (ll)1 << 62;

ll h[100001] = {};
ll k[100001] = {};

ll n, a, b;
//bool holocost(ll t) {
//	rep(i, 0, n) k[i] = h[i] - b * t;
//
//	ll cnt = 0;
//	rep(i, 0, n) {
//		if (h[i] > 0) {
//			cnt += k[i] / (a - b);
//			if (k[i] % (a - b) != 0)cnt++;
//		}
//	}
//	return cnt <= t;
//}

bool condition(ll x) {
	rep(i, 0, n) {
		k[i] = h[i];
	}
	rep(i, 0, n) k[i] -= x * b;
	ll cnt = 0;
	rep(i, 0, n) {
		if (k[i] > 0) {
			ll d = a - b;
			cnt += k[i] / d;
			if (k[i] % d != 0)cnt++;
		}
	}
	return cnt <= x;
}

int main() {
	cin >> n >> a >> b;
	rep(i, 0, n) cin >> h[i];

	ll l = -1;
	ll r = (ll)1 << 30;
	ll m;
	while (r - l > 1) {
		m = (l + r) / 2;
		if (holocost(m)) {
			r = m;
		}
		else {
			l = m;
		}
	}
	cout << r << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:58:21: error: 'holocost' was not declared in this scope
   58 |                 if (holocost(m)) {
      |                     ^~~~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

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

bool solve(long long total) {
  long long cnt_a = total;
  long long cnt_b = 0;
  for (long long i = 0; i < n; i++) {
    long long rest = h[i] - a * cnt_a - b * cnt_b;
    if (rest > 0) {
      return false;
    }
    long long cnt = - rest / (a - b);
    cnt_a = cnt;
    cnt_b = total - cnt_a;
  }
  return true;
}

long long main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> a >> b;
  h = vector<long long>(n);
  for (long long i = 0; i < n; i++) {
    cin >> h[i];
  }
  sort(h.begin(), h.end(), greater<long long>());
  long long ok = (h[0] + b - 1) / b;
  long long ng = (h[0] + a - 1) / a - 1;
  while (ok - ng > 1) {
    long long mid = (ok + ng) / 2;
    if (solve(mid)) {
      ok = mid;
    } else {
      ng = mid;
    }
  }
  cout << ok << endl;
  return 0;
}

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

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

int N,i,j,k;
int64_t A,B,sm,ans,mx=0;
int64_t h[100010];
bool check(int64_t t){
  sm = 0;
  for(i = 0;i < N;i++){
    if(h[i] - B*t > 0){
      sm += (h[i] - B*t + A - B - 1)/(A - B);
    }
  }
  if(sm <= t){
    return false;
  }else{
    return true;
  }
}

int64_t BinarySearch(int64_t low, int64_t high, function< bool(int64_t) > check){
  while(1){
    if(high-low == 1){
      return high;
      break;
    }
    ll mid = low+(high-low)/2;
    if(check(mid)){
      low = mid;
    }else{
      high = mid;
    }
  }
}
int main(){
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  // ifstream in("input.txt");
  // cin.rdbuf(in.rdbuf());

  cin >> N >> A >> B;
  for(i = 0;i < N;i++){
    cin >> h[i];
    mx = max(mx, h[i]);
  }

  ans = BinarySearch(0LL, mx+1, check);
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int64_t BinarySearch(int64_t, int64_t, std::function<bool(long int)>)':
a.cc:27:5: error: 'll' was not declared in this scope
   27 |     ll mid = low+(high-low)/2;
      |     ^~
a.cc:28:14: error: 'mid' was not declared in this scope
   28 |     if(check(mid)){
      |              ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  scanf("%d",&N);
  int a,b;
  int score = 0;
  int scoresum = 0;
  scanf("%d%d",&a,&b);
  vector <int> hp(N);
  for(int i = 0;i<N;i++){
    scanf("&d",&hp.at(i));
  }
  sort(hp.begin(),hp.end());
  reverse(hp.begin,hp.end());
  
  for(int i = 0;i<N;i++){
    score = 0;
    if(hp[i]>0){
      if(hp[i]%a == 0){
        score += hp[i]/a;
      }
      else{
        score += (hp[i]/a)+1;
      }
      
      for(int k = i+1;k<N;k++){
        if(hp[k]>0){
          hp[k] - score*b;
        }
      }
    }
    scoresum += score;
  }
  cout << scoresum << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:10: error: no matching function for call to 'reverse(<unresolved overloaded function type>, std::vector<int>::iterator)'
   15 |   reverse(hp.begin,hp.end());
      |   ~~~~~~~^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:1083:5: note: candidate: 'void std::reverse(_BIter, _BIter) [with _BIter = __gnu_cxx::__normal_iterator<int*, vector<int> >]'
 1083 |     reverse(_BidirectionalIterator __first, _BidirectionalIterator __last)
      |     ^~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1083:36: note:   no known conversion for argument 1 from '<unresolved overloaded function type>' to '__gnu_cxx::__normal_iterator<int*, std::vector<int> >'
 1083 |     reverse(_BidirectionalIterator __first, _BidirectionalIterator __last)
      |             ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:249:1: note: candidate: 'template<class _ExecutionPolicy, class _BidirectionalIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::reverse(_ExecutionPolicy&&, _BidirectionalIterator, _BidirectionalIterator)'
  249 | reverse(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __last);
      | ^~~~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:249:1: note:   candidate expects 3 arguments, 2 provided
Language: C++

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

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define in(x) cin >> x
#define out(str) cout << str << endl

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; }

int N,A,B,maxi=0,add,sum,low,high,mid;

bool check(int T,int temp[N],int add);

int main(){
    cin>>N>>A>>B;
    int h[N];
    rep(i,N){
        cin>>h[i];
        maxi=max(maxi,h[i]);
    }
    maxi=(maxi/B)+1;
    add=A-B;
    low=0;
    high=maxi;
    while(low<=high){
        mid=(low+high)/2;
        if(check(mid,h,add)){
            if(check(mid-1,h,add)){
                high=mid-1;
            }
            else{
                out(mid);
                return 0;
            }
        }
        else{
            if(check(mid+1,h,add)){
                out(mid);
                return 0;
            }
            else{
                low=mid+1;
            }
        }
    }
    return 0;
}

bool check(int T,int temp[],int add){
    sum=0;
    rep(j,N){
        temp[j]-=T*B;
        if(temp[j]>0){
            sum+=temp[j]/add;
            if(temp[j]%add!=0)sum+=1;
            }
    }
    if(sum>T){
        return false;
    }else{
        return true;
    }
}


Compiler output:
a.cc:22:27: error: size of array 'temp' is not an integral constant-expression
   22 | bool check(int T,int temp[N],int add);
      |                           ^
Language: C++

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

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define in(x) cin >> x
#define out(str) cout << str << endl

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; }

int N,A,B,maxi=0,add,sum,low,high,mid;

bool check(int T,int temp[N],int add);

int main(){
    cin>>N>>A>>B;
    int h[N];
    rep(i,N){
        cin>>h[i];
        maxi=max(maxi,h[i]);
    }
    maxi=(maxi/B)+1;
    add=A-B;
    low=0;
    high=maxi;
    while(low<=high){
        mid=(low+high)/2;
        if(check(mid,h,add)){
            if(check(mid-1,h,add)){
                high=mid-1;
            }
            else{
                out(mid);
                return 0;
            }
        }
        else{
            if(check(mid+1,h,add)){
                out(mid);
                return 0;
            }
            else{
                low=mid+1;
            }
        }
    }
    return 0;
}

bool check(int T,int temp[N],int add){
    sum=0;
    rep(j,N){
        temp[j]-=T*B;
        if(temp[j]>0){
            sum+=temp[j]/add;
            if(temp[j]%add!=0)sum+=1;
            }
    }
    if(sum>T){
        return false;
    }else{
        return true;
    }
}


Compiler output:
a.cc:22:27: error: size of array 'temp' is not an integral constant-expression
   22 | bool check(int T,int temp[N],int add);
      |                           ^
a.cc:59:27: error: size of array 'temp' is not an integral constant-expression
   59 | bool check(int T,int temp[N],int add){
      |                           ^
Language: C++

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

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define in(x) cin >> x
#define out(str) cout << str << endl

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; }

int N,A,B,maxi=0,add,sum,low,high,mid;

bool check(int T,int temp[N],int add){
    sum=0;
    rep(j,N){
        temp[j]-=T*B;
        if(temp[j]>0){
            sum+=temp[j]/add;
            if(temp[j]%add!=0)sum+=1;
            }
    }
    if(sum>T){
        return false;
    }else{
        return true;
    }
}

int main(){
    cin>>N>>A>>B;
    int h[N];
    rep(i,N){
        cin>>h[i];
        maxi=max(maxi,h[i]);
    }
    maxi=(maxi/B)+1;
    add=A-B;
    low=0;
    high=maxi;
    while(low<=high){
        mid=(low+high)/2;
        if(check(mid,h,add)){
            if(check(mid-1,h,add)){
                high=mid-1;
            }
            else{
                out(mid);
                return 0;
            }
        }
        else{
            if(check(mid+1,h,add)){
                out(mid);
                return 0;
            }
            else{
                low=mid+1;
            }
        }
    }
    return 0;
}

Compiler output:
a.cc:22:27: error: size of array 'temp' is not an integral constant-expression
   22 | bool check(int T,int temp[N],int add){
      |                           ^
Language: C++

#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstring>#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <queue>
#include <iostream>
#include <bitset>
using namespace std;
#define N 100005
#define ll long long
ll a[N],b[N],n,A,B;
int check(ll x)
{
	for(int i=1;i<=n;i++)b[i]=a[i]-x*B;
	for(int i=1;i<=n;i++)if(b[i]>0)x-=(ll)((1.0*b[i])/(1.0*A-B)+0.9999);
	return x>=0;
}
int main()
{
	// freopen("Study.in","r",stdin);freopen("Study.out","w",stdout);
	scanf("%lld%lld%lld",&n,&A,&B);
	for(int i=1;i<=n;i++)scanf("%lld",&a[i]);
	ll l=1,r=1ll<<30;
	while(l<r)
	{
		ll m=(l+r)>>1;
		if(check(m))r=m;
		else l=m+1;
	}printf("%lld\n",l);return 0;
}
#include <queue>
#include <iostream>
#include <bitset>
using namespace std;
#define N 100005
#define ll long long
ll a[N],b[N],n,A,B;
int check(ll x)
{
	memcpy(b,a,sizeof(a));
	for(int i=1;i<=n;i++)b[i]=a[i]-x*B;
	for(int i=1;i<=n;i++)x-=(ll)(ceil(1.0*b[i]/(A-B)));
	return x>=0;
}
int main()
{
	// freopen("Study.in","r",stdin);freopen("Study.out","w",stdout);
	scanf("%lld%lld%lld",&n,&A,&B);
	for(int i=1;i<=n;i++)scanf("%lld",&a[i]);
	ll l=1,r=1ll<<30;
	while(l<r)
	{
		ll m=(l+r)>>1;
		if(check(m))r=m;
		else l=m+1;
	}printf("%lld\n",l);return 0;
}

Compiler output:
a.cc:5:19: warning: extra tokens at end of #include directive
    5 | #include <cstring>#include <cstdio>
      |                   ^
a.cc:42:4: error: redefinition of 'long long int a [100005]'
   42 | ll a[N],b[N],n,A,B;
      |    ^
a.cc:16:4: note: 'long long int a [100005]' previously declared here
   16 | ll a[N],b[N],n,A,B;
      |    ^
a.cc:42:9: error: redefinition of 'long long int b [100005]'
   42 | ll a[N],b[N],n,A,B;
      |         ^
a.cc:16:9: note: 'long long int b [100005]' previously declared here
   16 | ll a[N],b[N],n,A,B;
      |         ^
a.cc:42:14: error: redefinition of 'long long int n'
   42 | ll a[N],b[N],n,A,B;
      |              ^
a.cc:16:14: note: 'long long int n' previously declared here
   16 | ll a[N],b[N],n,A,B;
      |              ^
a.cc:42:16: error: redefinition of 'long long int A'
   42 | ll a[N],b[N],n,A,B;
      |                ^
a.cc:16:16: note: 'long long int A' previously declared here
   16 | ll a[N],b[N],n,A,B;
      |                ^
a.cc:42:18: error: redefinition of 'long long int B'
   42 | ll a[N],b[N],n,A,B;
      |                  ^
a.cc:16:18: note: 'long long int B' previously declared here
   16 | ll a[N],b[N],n,A,B;
      |                  ^
a.cc:43:5: error: redefinition of 'int check(long long int)'
   43 | int check(ll x)
      |     ^~~~~
a.cc:17:5: note: 'int check(long long int)' previously defined here
   17 | int check(ll x)
      |     ^~~~~
a.cc:50:5: error: redefinition of 'int main()'
   50 | int main()
      |     ^~~~
a.cc:23:5: note: 'int main()' previously defined here
   23 | int main()
      |     ^~~~
Language: C++


#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#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 VSORT(v) sort(v.begin(), v.end());
#define REVERSE(v,n) reverse(v,v+n);
#define VREVERSE(v) reverse(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)
#define INF 999999999
#define m0(x) memset(x,0,sizeof(x))
#define fill(x,y) memset(x,y,sizeof(x))

using namespace std;
#define int long long

int dy[4] = { 0,0,1,-1 };
int dx[4] = { 1,-1,0,0 };
int dxx[8] = { 0,0,1,1,1,-1,-1,-1 };
int dyy[8] = { 1,-1,0,1,-1,0,1,-1 };


ll m = 1000000007;

const int MOD = 1000000007;

ll gcd(ll x, ll y) {
	ll m = max(x, y), n = min(x, y);
	if (m%n == 0)return n;
	else return gcd(m%n, n);
}
ll lcm(ll x, ll y) {
	return x / gcd(x, y)*y;
}

ll myPow(ll x, ll n, ll m) {
	if (n == 0)
		return 1;
	if (n % 2 == 0)
		return myPow(x * x % m, n / 2, m);
	else
		return x * myPow(x, n - 1, m) % m;
}

//a÷b以上の最小の整数
ll CEIL(ll a, ll b) {
	return (a + b - 1) / b;
}

long long nCr(int n, int r) {
	if (r > n / 2) r = n - r; // because C(n, r) == C(n, n - r)
	long long ans = 1;
	int i;

	for (i = 1; i <= r; i++) {
		ans *= n - r + i;
		ans /= i;
	}

	return ans;
}

int N, A, B;
int h[100010], x[100010];

bool isOK(int K) {
	ll cnt = 0;
	REP(i, N) {
		if (B*K < h[i]) {
			cnt += CEIL(h[i] - B * K, A - B);
		}
	}
	if (cnt <= K)return true;
	else return false;
}

int binary_search() {
	int ng = 0; //「index = 0」が条件を満たすこともあるので、初期値は -1
	ll ok = 1000000000; // 「index = a.size()-1」が条件を満たさないこともあるので、初期値は a.size()

						/* ok と ng のどちらが大きいかわからないことを考慮 */
	while (abs(ok - ng) > 1) {
		int mid = (ok + ng) / 2;

		if (isOK(mid)) ok = mid;
		else ng = mid;
	}
	return ok;
}

int main() {
	cin >> N >> A >> B;
	REP(i, N) {
		cin >> h[i];
	}

	int ans = binary_search();
	cout << ans << endl;
}


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

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();
		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 l = 0, r = Integer.MAX_VALUE;
		while(r - l != 1) {
			long mid = (r + l) / 2;
			long[] x = Arrays.copyOf(h, h.length);
			long cnt = 0;
			for(int i = 0; i < x.length; i++) {
				if(x[i] - b × mid <= 0) continue;
				cnt += ((x[i] - b * mid) + (a - b - 1)) / (a - b);
			}
			if(mid >= cnt) r = mid;
			else l = mid;
		}
		System.out.println(r);
	}
}


Compiler output:
Main.java:18: error: illegal character: '\u00d7'
				if(x[i] - b ? mid <= 0) continue;
				            ^
Main.java:18: error: not a statement
				if(x[i] - b ? mid <= 0) continue;
				                  ^
Main.java:18: error: ';' expected
				if(x[i] - b ? mid <= 0) continue;
				                      ^
3 errors
Language: C++

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

#define all(v) (v).begin(), (v).end()
using namespace std;

int ceil(int numerator, int denominator)
{
	return (numerator/denominator + (numerator%denominator != 0));
}

int possible(vector <int> H, long long A, long long B, long long explosions)
{
	for(int i = 1; i < H.size(); i++)
	{
		H[i] -= (explosions*B);
	}
	
	int explosions_used = 0;
	for(int i = H.size() - 1; i > 0; i++)
	{
		explosions_used += ceil(A[i], A - B);
	}
	
	return (explosions_used <= explosions);
}

int main() 
{
    int no_of_monsters, A, B;
    cin >> no_of_monsters >> A >> B;
    
    vector <int> health(no_of_monsters + 1);
    for(int i = 1; i <= no_of_monsters; i++)
    	cin >> health[i];
    	
    sort(all(health));
    
    long long left = 1, right = 1e9;
    while(left <= right)
    {
    	long long mid = (left + right) >> 1;
    	
    	if(possible(health, A, B, mid))
    	{
    		if(mid == left || !possible(health, A, B, mid - 1))
    		{
    			printf("%lld\n", mid);
    			break;
    		}
    		else
    		{
    			right = mid - 1;
    		}
    	}
    	else
    	{
    		left = mid + 1;
    	}
    }
	return 0;
}


Compiler output:
a.cc: In function 'int possible(std::vector<int>, long long int, long long int, long long int)':
a.cc:23:42: error: invalid types 'long long int[int]' for array subscript
   23 |                 explosions_used += ceil(A[i], A - B);
      |                                          ^
Language: C++

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

using ll = long long;

bool isenough(int t, int A, int B, vector<int>& v) {
    ll sm = 0;
    for(int i = 0; i < v.size(); i++) {
        sm += ceil((double)(v[i] - B * t) / (A - B));
    }
    if(sm > t) return false;
    else return true;
}

int main() {
    int N, A, B;
    cin >> N >> A >> B;
    vector<int> hs(N);
    for(int i = 0; i < N; i++) cin >> hs[i];
    sort(hs.begin(), hs.end());

    int ng = 0, ok = hs[N-1] / B + 1;
    while(abs(ng - ok) > 1) {
        int c = (ng + ok) / 2;
        if(isenough(c, A, B, hs)) ok = c;
        else ng = c;
    }

    cout << ok << endl;

    return 0;
}

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

#include <iostream>
#include <algorithm>
#include <functional>
#include<vector>
#include<math.h>
#include<bitset>
#include<string>
#include <deque>
#include<queue>
#include<map>

using namespace std;


int main() {
	long long int N,A,B;
	cin >> N>>A>>B;
	long long int H[100008];
	for (int i = 0; i < N; i++) {
		cin >> H[i];
	}
	long long int T;
	for () {
		for (int i = 0; i < N; i++) {
			
		}

	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:14: error: expected primary-expression before ')' token
   23 |         for () {
      |              ^
a.cc:29:9: error: expected primary-expression before 'return'
   29 |         return 0;
      |         ^~~~~~
a.cc:28:10: error: expected ';' before 'return'
   28 |         }
      |          ^
      |          ;
   29 |         return 0;
      |         ~~~~~~
a.cc:29:9: error: expected primary-expression before 'return'
   29 |         return 0;
      |         ^~~~~~
a.cc:28:10: error: expected ')' before 'return'
   28 |         }
      |          ^
      |          )
   29 |         return 0;
      |         ~~~~~~
a.cc:23:13: note: to match this '('
   23 |         for () {
      |             ^
Language: C++

n , a, b = map(int,input().split())
teki = []
ans = 0
for i in range(n):
    teki.append(int(input()))

q = a- b
ss = max(teki)

m =0
for i in range(n):
    u = teki[i] // b  + 1
    if m <= u:
        m = u

for i in range(n):
    teki[i] = teki[i] - b * (m)
    if teki[i] <= 0:
        teki[i] == 0
ans += m


while 0 in teki:
    teki.remove(0)
"""
while tekis != []:
    for i in range(len(tekis)):
        tekis[i] = tekis[i] - b
    
    k = max(tekis)
    tekis.remove(k)
    tekis.append(k + a- b)
    for i in range(len(tekis)):
        if tekis[i] <= 0:
            tekis[i] = 0
    while 0 in tekis:
        tekis.remove(0)
    ans += 1


"""
print(ans-1)

Compiler output:
a.cc:25:3: warning: missing terminating " character
   25 | """
      |   ^
a.cc:25:3: error: missing terminating " character
a.cc:41:3: warning: missing terminating " character
   41 | """
      |   ^
a.cc:41:3: error: missing terminating " character
a.cc:1:1: error: 'n' does not name a type
    1 | n , a, b = map(int,input().split())
      | ^
Language: C++

#include <iostream>
#include <functional>
#include <vector>
#include <iostream>
#include <queue>

using namespace std;

bool cleared(vector<int> &v, int k, int a, int b){
  int rest = k;
  int d = a-b;
  for (auto it=v.begin();it != v.end();it++) {
    rest -= (*it - k*b)/d;
    if ((*it - k*b)%d != 0) {
      rest--;
    }
    if (rest < 0) {
      return(false);
    }
  }
  return(true);
}

bool cmp(int a, int b) {
  return(a>b);
}

int main(){
  //  priority_queue<int> q;
  vector<int> v;
  int acc_b = 0;
  int n, a, b, d;
  int max_h;
  int count = 0;
  cin >> n >> a >> b;
  d = a - b;
  for (int i=0;i<n;i++) {
    int h;
    cin >> h;
    //    q.push(h);
    v.push_back(h);
  }
  sort(v.begin(), v.end(), cmp);
  long long ub, lb, ans;
  lb = v.front()/a;
  ub = v.front()/b + 1;

  while (lb<=ub) {
    long long k = (ub + lb)/2;
    bool result = cleared(v, k, a, b);
    if (result) {
      if (k-1 == lb) {
	ans = k;
	break;
      }
      ub = k;
    } else {
      if (k+1 == ub) {
	ans = ub;
	break;
      }
      lb = k;
    }
  }
  cout << ans << endl;
  return(0);
  // while (true) {
  //   max_h = q.top();
  //   if (acc_b >= max_h) {
  //     break;
  //   }
  //   q.pop();
  //   cerr << max_h << endl;
  //   q.push(max_h - d);
  //   acc_b += b;
  //   count++;
  // }
  // cout << count << endl;	
}


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

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <tuple>

using ll = long long;
using namespace std;
#define modmod 1000000007

int N;
ll h[100006];
ll A,B;


bool enough(ll t){
    ll sum = 0;
    for(int i = 0; i < N; i++){
        if(h[i]-(B*t) <= 0){
            continue;
        }
        sum += (h[i]-(B*t))/(A-B);
        if((h[i]-(B*t))/(A-B) != 0){
            sum++;
        }
    }
    return sum <= t;
}

int main(){

    cin >> N >> A >> B;

    for(int i = 0; i < N; i++){
        cin >> h[i];
    }
    sort(h,h+N);
    ll max_h = h[N-1];
    ll left = 0, right = max_h/B + 1;
    while(right - left > 1){
        ll mid = (left+right) / 2;
        if(enough(mid)){
            right=mid;
        }else{
            left=mid;
        }
    }

    cout << right << mid;

    return 0;
}


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

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
int h[100009];
int main(){
	int n;
	long long int a,b;
	cin>>n>>a>>b;
	for(int i=0;i<n;i++){
		cin>>h[i];
	}
	long long int sa=a-b;
	long long int mi=0,ma=1000000000,mid;
	while(ma-mi>1){
		mid=(mi+ma)/2;
		long long int cnt=0;
		for(int i=0;i<n;i++){
			if(h[i]>b*mid){
				cnt+=,(h[i] - b * mid + a - b - 1) / (a-b);
			}
		}
		if(cnt>mid){
			mi=mid;
		}
		else{
			ma=mid;
		}
	}
	cout<<ma<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:38: error: expected primary-expression before ',' token
   21 |                                 cnt+=,(h[i] - b * mid + a - b - 1) / (a-b);
      |                                      ^
Language: C++

#include <iostream>
#include<cstdlib>
#include<queue>
#include<set>
#include<vector>
#include<string>
#include<algorithm>
#include<stack>
#include<map>
#include<deque>
#include<cstdio>
using namespace std;
#define rep(i,a) for(int i=0;i<a;i++)
#define mp make_pair
#define pb push_back
#define ll __int64
//#define ll long long
#define P pair<ll,ll>

int n,a,b;
ll t[1100000];
ll tt[110000];

bool che(ll x){
	rep(i,n)tt[i]=t[i];

	ll cnt=0;//Aで殴る必要のある回数
	rep(i,n){
		tt[i]-=b*x;
		
		if(tt[i]>0){
			cnt+=tt[i]/(a-b);
			if(tt[i]%(a-b))cnt++;
		}
	}
	if(cnt>x)return 0;
	else return 1;
}

int main(){
	cin>>n>>a>>b;
	rep(i,n)cin>>t[i];
	ll l=0,r=10000000001;
	ll mid=(l+r)/2;

	rep(i,100){
		if(che(mid))r=mid;
		else l=mid;
		mid=(r+l)/2;
	}
	
	cout<<mid+1<<endl;
	return 0;
}

Compiler output:
a.cc:16:12: error: '__int64' does not name a type; did you mean '__int64_t'?
   16 | #define ll __int64
      |            ^~~~~~~
a.cc:21:1: note: in expansion of macro 'll'
   21 | ll t[1100000];
      | ^~
a.cc:16:12: error: '__int64' does not name a type; did you mean '__int64_t'?
   16 | #define ll __int64
      |            ^~~~~~~
a.cc:22:1: note: in expansion of macro 'll'
   22 | ll tt[110000];
      | ^~
a.cc:16:12: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
   16 | #define ll __int64
      |            ^~~~~~~
a.cc:24:10: note: in expansion of macro 'll'
   24 | bool che(ll x){
      |          ^~
a.cc: In function 'int main()':
a.cc:42:22: error: 't' was not declared in this scope
   42 |         rep(i,n)cin>>t[i];
      |                      ^
a.cc:16:12: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
   16 | #define ll __int64
      |            ^~~~~~~
a.cc:43:9: note: in expansion of macro 'll'
   43 |         ll l=0,r=10000000001;
      |         ^~
a.cc:44:12: error: expected ';' before 'mid'
   44 |         ll mid=(l+r)/2;
      |            ^~~
a.cc:47:24: error: 'mid' was not declared in this scope
   47 |                 if(che(mid))r=mid;
      |                        ^~~
a.cc:47:27: error: 'che' cannot be used as a function
   47 |                 if(che(mid))r=mid;
      |                           ^
a.cc:47:29: error: 'r' was not declared in this scope
   47 |                 if(che(mid))r=mid;
      |                             ^
a.cc:48:22: error: 'l' was not declared in this scope
   48 |                 else l=mid;
      |                      ^
a.cc:49:17: error: 'mid' was not declared in this scope
   49 |                 mid=(r+l)/2;
      |                 ^~~
a.cc:49:22: error: 'r' was not declared in this scope
   49 |                 mid=(r+l)/2;
      |                      ^
a.cc:49:24: error: 'l' was not declared in this scope
   49 |                 mid=(r+l)/2;
      |                        ^
a.cc:52:15: error: 'mid' was not declared in this scope
   52 |         cout<<mid+1<<endl;
      |               ^~~