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

#include <bits/stdc++.h>
using namespace std;
 
#define REP(i, s) for (int i = 0; i < s; ++i)
#define ALL(v) (v).begin(), (v).end()
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define DEBUG
#define int long long
#define INF 1e18
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; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T> ostream& operator << (ostream &s, set<T> P)
{ EACH(it, P) { s << "<" << *it << "> "; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }
template<class T>void show(vector<T>v){for (int i = 0; i < v.size(); i++){cerr<<v[i]<<" ";}cerr<<"\n";}
typedef long long ll;


signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n ,a, b;
    cin>>n>>a>>b;
    vector<int>h(n);
    for (int i = 0; i < n; i++)
    {
        cin>>h[i];
    }
    int l=0;
    int r=INF;
    while(l+1<r){
        int c=(l+r)/2;
        vector<int>x(n);
        int cnt=0;
        for (int i = 0; i < n; i++)
        {
            x[i]=max(h[i]-b*c; , 0LL);
            
                cnt+=(x[i]+a-1) /(a);
            
        }
      //  cerr<<cnt<<endl;
        if(cnt<=c){
            r=c;
        }
        else{
            l=c;
        }
    }
    cout<<r<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:30: error: expected ')' before ';' token
   46 |             x[i]=max(h[i]-b*c; , 0LL);
      |                     ~        ^
      |                              )
a.cc:46:32: error: expected primary-expression before ',' token
   46 |             x[i]=max(h[i]-b*c; , 0LL);
      |                                ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
#define REP(i, s) for (int i = 0; i < s; ++i)
#define ALL(v) (v).begin(), (v).end()
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define DEBUG
#define int long long
#define INF 1e18
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; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T> ostream& operator << (ostream &s, set<T> P)
{ EACH(it, P) { s << "<" << *it << "> "; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }
template<class T>void show(vector<T>v){for (int i = 0; i < v.size(); i++){cerr<<v[i]<<" ";}cerr<<"\n";}
typedef long long ll;


signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n ,a, b;
    cin>>n>>a>>b;
    vector<int>h(n);
    for (int i = 0; i < n; i++)
    {
        cin>>h[i];
    }
    int l=0;
    int r=INF;
    while(l+1<r){
        int c=(l+r)/2;
        vector<int>x(n);
        int cnt=0;
        for (int i = 0; i < n; i++)
        {
            x[i]=max(h[i]-b*c; , 0LL)
            
                cnt+=(x[i]+a-1) /(a);
            
        }
      //  cerr<<cnt<<endl;
        if(cnt<=c){
            r=c;
        }
        else{
            l=c;
        }
    }
    cout<<r<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:30: error: expected ')' before ';' token
   46 |             x[i]=max(h[i]-b*c; , 0LL)
      |                     ~        ^
      |                              )
a.cc:46:32: error: expected primary-expression before ',' token
   46 |             x[i]=max(h[i]-b*c; , 0LL)
      |                                ^
Language: C

#include<iostream>
#include<vector>
#include<algorithm>
#include<iterator>
#include<cmath>
#include<functional>
using namespace std;

int binsearch(long l, long r, long A, long B, vector<long> h, bool (*ptn)(long, long, long, vector<long>)){
    while(r - l > 1){
        long m = (l + r) / 2;
        if(ptn(m, A, B, h)){
            l = m;
        }else{
            r = m;
        }
    }
    return l;
}

bool search(long i, long A, long B, vector<long> h){
    if(*max_element(h.begin(), h.end()) <= B*i){
        return false;
    }
    long r = 0;
    for(auto j = h.begin(); j < h.end(); j++){
        long a = ceil((float(*j) - float(B)*i)/float(A-B));
        if(a > 0){
            r += a;
        }
    }
    if(r <= i){
        return false;
    }
    return true;
}

int main(){
    long N, A, B;
    cin >> N >> A >> B;
    vector<long> h(N);
    for(long i=0;i<N;i++){
        cin >> h.at(i);
    }
    cout << 1 + binsearch(0, 1000000000, A, B, h, search) << endl;
}



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

#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=int(a);i<int(b);i++)
typedef long long ll;
typedef pair<ll,ll> P;


int main(){
    ll n,a,b,h[100010];
    cin>>n>>a>>b;
    rep(i,0,n)cin>>h[i];
    
    ll r=1e11,l=0,c=a-b,mid;
    while(l+1<r){
        mid=(r+l)/2;
        ll cn=0;
        rep(i,0,n){
            ll tm=(h[i]-b*mid+c-1)/c;
            cn+=max(tm,0LL);
        }
        if(cn<=mid)r=mid;
        else l=mid;
    }
    cout<<r<<endl;
}

    



#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=int(a);i<int(b);i++)
typedef long long ll;
typedef pair<ll,ll> P;


int main(){
    ll n,a,b,h[100010];
    cin>>n>>a>>b;
    rep(i,0,n)cin>>h[i];
    
    ll r=1e9+1,l=0,c=a-b,mid;
    while(l+1<r){
        mid=(r+l)/2;
        ll cn=0;
        rep(i,0,n){
            ll tm=(h[i]-b*mid+c-1)/c;
            cn+=max(tm,0LL);
        }
        if(cn<=mid)r=mid;
        else l=mid;
    }
    cout<<r<<endl;
}

    













Compiler output:
a.cc:38:5: error: redefinition of 'int main()'
   38 | int main(){
      |     ^~~~
a.cc:8:5: note: 'int main()' previously defined here
    8 | int main(){
      |     ^~~~
Language: C++

#include <bits/stdc++.h>

#include <boost/range/adaptors.hpp>
#include <boost/range/irange.hpp>

using namespace std;
using namespace boost;
using namespace boost::adaptors;

int main() {
    int64_t n, a, b;
    cin >> n >> a >> b;

    vector<int64_t> h(n);
    for (auto&& hh : h) {
        cin >> hh;
    }

    auto can_beat = [&](int64_t m) {
        int64_t t = 0;

        for (auto hh : h) {
            auto h1 = hh - m * b;
            if (h1 > 0) {
                t += (h1 - 1) / (a - b) + 1;
            }
        }

        return t <= m;
    };

    auto r = irange(0L, 1000000001L);
    auto ans = *partition_point(r.begin(), r.end(), not_fn(can_beat));

    cout << ans << endl;
}

Compiler output:
a.cc:3:10: fatal error: boost/range/adaptors.hpp: No such file or directory
    3 | #include <boost/range/adaptors.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
#define rep(i, n) for (int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
ll INF = 1e18;

/*解説AC*/

ll n, a, b;
vector<ll>v;

bool enough(ll t){
    ll tmp = 0;
    rep(i, n){
        /*a-b-1してから割ると良い*/
        tmp += max(0, (v[i]-t*b+(a-b)-1)/(a-b));
    }
    if(tmp<=t) return true;
    else return false;
}
 
int main(void){
    cin>>n>>a>>b;
    v.resize(n);
    rep(i, n) cin>>v[i];
    ll left=0;
    ll right=INF;
    while((right-left)>1){
        ll mid=(left+right)/2;
        if(enough(mid)) right=mid;
        else left=mid;
    }
    cout<<right<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'bool enough(ll)':
a.cc:16:19: error: no matching function for call to 'max(int, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type)'
   16 |         tmp += max(0, (v[i]-t*b+(a-b)-1)/(a-b));
      |                ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:16:19: note:   deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'})
   16 |         tmp += max(0, (v[i]-t*b+(a-b)-1)/(a-b));
      |                ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:16:19: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   16 |         tmp += max(0, (v[i]-t*b+(a-b)-1)/(a-b));
      |                ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
#define tii tuple<int,int,int>
#define Priq priority_queue<int,vi,greater<int>>
#define pb push_back
#define mp make_pair
#define INF (1ll<<50)
int N,A,B;
int C[100000];
int func(X){
  int ret=0;
  rep(i,0,N){
    ret+=max(0ll,(C[i]-B*X)+A-B-1)/(A-B);
  }
  return ret;
}
signed main(){
  cin>>N>>A>>B;
  rep(i,0,N) C[i];
  int left=0,right=INF;
  while(left+1<right){
    int mid=(left+right)/2;
    if(func(mid)<=mid) right=mid;
    else left=mid;
  }
  int ans=right;
  if(func(left)<=left) ans=left;
  cout<<ans<<endl;
  }


Compiler output:
a.cc:21:10: error: 'X' was not declared in this scope
   21 | int func(X){
      |          ^
a.cc: In function 'int main()':
a.cc:34:12: error: 'func' cannot be used as a function
   34 |     if(func(mid)<=mid) right=mid;
      |        ~~~~^~~~~
a.cc:38:10: error: 'func' cannot be used as a function
   38 |   if(func(left)<=left) ans=left;
      |      ~~~~^~~~~~
Language: Java

import java.util.Scanner;
 
public class Main {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();
    int a = scan.nextInt();
    int b = scan.nextInt();
    int[] h = new int[n];
    long s = 0;
    for (int i = 0; i < n; i++) {
      h[i] = scan.nextInt();
      s += (h[i] - 1) / a + 1;
    }
    long left = -1;
    long right = s;
    while (right - left > 1) {
      long mid = (left + right) / 2;
      if (possible(a, b, h, mid)) {
        right = mid;
      } else {
        left = mid;
      }
    }
    System.out.println(right);
  }
  
  private static boolean possible(int A, int B, int[] h_array, long p_maxp_maxp_max) {
    long p = 0;
    for (int h : h_array) {
      if (h <= p_maxp_maxp_max * B) {
        continue;
      }
      long pi = (h - p_maxp_max * B - 1) / (A - B) + 1;
      p += pi;
      if (p > p_max){
        return false;
      }
    }
    return true;
  }
}

Compiler output:
Main.java:34: error: cannot find symbol
      long pi = (h - p_maxp_max * B - 1) / (A - B) + 1;
                     ^
  symbol:   variable p_maxp_max
  location: class Main
Main.java:36: error: cannot find symbol
      if (p > p_max){
              ^
  symbol:   variable p_max
  location: class Main
2 errors
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; ++i)
#define ALL(v) v.begin(), v.end()
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1000000001;

ll n,a,b,c;
bool bin(vector<ll> h,ll t)
{
   ll at= 0;
   rep(i,n)
   {
      h[i] -= t*b;
      at += (max(0,h[i])+c-1)/c;
   }
   if(at>t)
   {
      return false;
   }
   return true;
}

int main()
{
   
   cin >> n >> a >> b;
   c = a - b;
   vector<ll> h(n);
   rep(i,n)cin >> h[i];
   int left = -1,right = INF;
   while(1)
   {
      ll mid = (left+right)/2;
      if(bin(h,mid))
      {
         right = mid;
      }
      else
      {
         left = mid;
      }
      //cout<<left<<';'<<right<<endl;
      if(right-left<=1)break;
   }
   cout<<right<<endl;
   return 0;
}

Compiler output:
a.cc: In function 'bool bin(std::vector<long long int>, ll)':
a.cc:16:17: error: no matching function for call to 'max(int, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type&)'
   16 |       at += (max(0,h[i])+c-1)/c;
      |              ~~~^~~~~~~~
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:16:17: note:   deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'})
   16 |       at += (max(0,h[i])+c-1)/c;
      |              ~~~^~~~~~~~
/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:16:17: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   16 |       at += (max(0,h[i])+c-1)/c;
      |              ~~~^~~~~~~~
Language: C++

clude <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n);i++)
#define sz(x) int(x.size())
typedef long long ll;
typedef pair<int,int> P;
 
int main(){ 
  int n, a, b;
  cin >> n >> a >> b;
  vector<int> h(n);
  rep(i,n) cin >> h[i];
 
  auto ok = [&](ll m) {
    ll cnt = 0;
    for (int i = 0; i < n; i++) {
      if (h[i] > b * m) {
        cnt += ((h[i] - b * m + (a-b-1))/(a-b));
      }
    }
    return cnt > m;
  };
 
  ll l = 0, r = 1e9;
  while (r - l > 1) {
    int m = (r + l) / 2;
    if (ok(m)) l = m;
    else r = m;
  }
  cout << r << endl;
  return 0;
} 

Compiler output:
a.cc:1:1: error: 'clude' does not name a type
    1 | clude <bits/stdc++.h>
      | ^~~~~
a.cc:6:9: error: 'pair' does not name a type
    6 | typedef pair<int,int> P;
      |         ^~~~
a.cc: In function 'int main()':
a.cc:10:3: error: 'cin' was not declared in this scope
   10 |   cin >> n >> a >> b;
      |   ^~~
a.cc:11:3: error: 'vector' was not declared in this scope
   11 |   vector<int> h(n);
      |   ^~~~~~
a.cc:11:10: error: expected primary-expression before 'int'
   11 |   vector<int> h(n);
      |          ^~~
a.cc:12:19: error: 'h' was not declared in this scope
   12 |   rep(i,n) cin >> h[i];
      |                   ^
a.cc: In lambda function:
a.cc:17:11: error: 'h' was not declared in this scope
   17 |       if (h[i] > b * m) {
      |           ^
a.cc: In function 'int main()':
a.cc:30:3: error: 'cout' was not declared in this scope
   30 |   cout << r << endl;
      |   ^~~~
a.cc:30:16: error: 'endl' was not declared in this scope
   30 |   cout << r << endl;
      |                ^~~~
Language: C++

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

const LL INF = 1e12;

LL N, A, B;
vector<LL> h;

bool f(LL K){
LL tmp = 0;
for(int i=0; i<N; i++){
 LL rem = h[i]-B*K;
 if(rem > 0) tmp += (rem+(A-B-1)) / (A-B);
 }
 return (tmp <= K);
 }

 LL binary_search(LL ok, LL ng){
 while (abs(ok - ng) > 1) {
 LL mid = (ok + ng) / 2;
 if(f(mid)) ok = mid;
 else ng = mid;
 }
 return ok;
 }

 int main(){
 cin >> N >> A >> B;
 h = vector<LL>(N); // サ イ ズ Nを確保
 for(int i=0; i<N; i++) cin >> h[i];
 cout << binary_search(INF, 0) << endl;
 }

Compiler output:
a.cc:4:7: error: 'LL' does not name a type
    4 | const LL INF = 1e12;
      |       ^~
a.cc:6:1: error: 'LL' does not name a type
    6 | LL N, A, B;
      | ^~
a.cc:7:8: error: 'LL' was not declared in this scope
    7 | vector<LL> h;
      |        ^~
a.cc:7:10: error: template argument 1 is invalid
    7 | vector<LL> h;
      |          ^
a.cc:7:10: error: template argument 2 is invalid
a.cc:9:8: error: 'LL' was not declared in this scope
    9 | bool f(LL K){
      |        ^~
a.cc:18:2: error: 'LL' does not name a type
   18 |  LL binary_search(LL ok, LL ng){
      |  ^~
a.cc: In function 'int main()':
a.cc:28:9: error: 'N' was not declared in this scope
   28 |  cin >> N >> A >> B;
      |         ^
a.cc:28:14: error: 'A' was not declared in this scope
   28 |  cin >> N >> A >> B;
      |              ^
a.cc:28:19: error: 'B' was not declared in this scope
   28 |  cin >> N >> A >> B;
      |                   ^
a.cc:29:13: error: 'LL' was not declared in this scope
   29 |  h = vector<LL>(N); // サ イ ズ Nを確保
      |             ^~
a.cc:29:15: error: template argument 1 is invalid
   29 |  h = vector<LL>(N); // サ イ ズ Nを確保
      |               ^
a.cc:29:15: error: template argument 2 is invalid
a.cc:30:33: error: invalid types 'int[int]' for array subscript
   30 |  for(int i=0; i<N; i++) cin >> h[i];
      |                                 ^
a.cc:31:24: error: 'INF' was not declared in this scope
   31 |  cout << binary_search(INF, 0) << endl;
      |                        ^~~
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
using namespace std;
typedef long long ll;
#define int ll
ll n,a,b;
bool judge(vector<ll> vec,ll k){
  for(int i=0;i<n;i++) vec[i]-=k*b;
  queue<ll> que;
  for(int i=0;i<n;i++) if(vec[i]>0) que.push(vec[i]);
  ll cnt=0;
  if(que.empty()) return true;
  while(!que.empty()){
    ll val=que.front();
    que.pop();
    cnt+=val/(a-b);
    if(val%(a-b)!=0) cnt++;
  }
  if(cnt<=k) return true;
  else retrun false;
}
signed main(){
  cin>>n>>a>>b;
  vector<ll> vec;
  for(int i=0;i<n;i++){
    ll a;
    cin>>a;
    vec.push_back(a);
  }
  ll lb=0,rb=1744174417441744;
  while(rb-lb>1){
    ll mid=(lb+rb)/2;
    if(judge(vec,mid)) rb=mid;
    else lb=mid;
  }
  cout<<rb<<endl;
}


Compiler output:
a.cc: In function 'bool judge(std::vector<long long int>, ll)':
a.cc:22:8: error: 'retrun' was not declared in this scope
   22 |   else retrun false;
      |        ^~~~~~
a.cc:23:1: warning: control reaches end of non-void function [-Wreturn-type]
   23 | }
      | ^
Language: Java

import java.util.Scanner;

public class Main {

	static int n, a, b, h[];
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		a = sc.nextInt();
		b = sc.nextInt();
		h = new int[n];
		for(int i=0;i<n;i++)h[i] = sc.nextInt();
		sc.close();
		
		int l = 0;
		int r = (int)1e9+100;
		while(l+1<r) {
			int c = (l+r)/2;
			if(check(c))r = c;
			else l = c;
		}
		
		System.out.println(r);
		
	}
	
	static boolean check(int x) {
		long num = 0;
		for(int i=0;i<n;i++) {
			int t = h[i];
			t -= b*x;
			if(t > 0) {
				num += ((long)t +(a-b-1) )/(a-b);
			}
			if(num>x) {
				return false;
			}
		}
		return true;
	}

Compiler output:
Main.java:40: error: reached end of file while parsing
	}
	 ^
1 error
Language: C++

#include <bits/stdc++.h>
#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 equals(a, b) (fabs((a) - (b)) < EPS)
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
const ll mod2 = 998244353;
const ll INF = 1e9;
const long double EPS = 1e-10;

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

  ll l = 0, r = INF + 1;
  while (r - l > 1) {
    ll m = (l + r) / 2;
    ll cnt = 0;
    rep(i, n) {
      cnt += max(0, (h[i] - m * b + a - b - 1) / (a - b));
    }
    if (cnt > m) l = m;
    else r = m;
  }
  cout << r << endl;



  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:17: error: no matching function for call to 'max(int, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type)'
   25 |       cnt += max(0, (h[i] - m * b + a - b - 1) / (a - b));
      |              ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:25:17: note:   deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'})
   25 |       cnt += max(0, (h[i] - m * b + a - b - 1) / (a - b));
      |              ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:25:17: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   25 |       cnt += max(0, (h[i] - m * b + a - b - 1) / (a - b));
      |              ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#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 equals(a, b) (fabs((a) - (b)) < EPS)
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
const ll mod2 = 998244353;
const int INF = 1e9;
const long double EPS = 1e-10;

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

  int l = 0, r = INF;
  while (r - l > 1) {
    ll m = (l + r) / 2;
    ll cnt = 0;
    rep(i, n) {
      int res = max(0, h[i] - m * b);
      cnt += (res + a - b - 1) / (a - b);
    }
    if (cnt > m) l = m;
    else r = m;
  }
  cout << r << endl;



  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:20: error: no matching function for call to 'max(int, ll)'
   25 |       int res = max(0, h[i] - m * b);
      |                 ~~~^~~~~~~~~~~~~~~~~
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:25:20: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   25 |       int res = max(0, h[i] - m * b);
      |                 ~~~^~~~~~~~~~~~~~~~~
/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:25:20: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   25 |       int res = max(0, h[i] - m * b);
      |                 ~~~^~~~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define rrep(i,a,b) for(ll i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
#define whole(f,x,...) ([&](decltype((x)) whole) { return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x)

ll binsearch(ll l, ll r, function<bool (ll)> p) { // [l, r), p is monotone
    assert (l < r);
    -- l; -- r; // (l, r]
    while (l + 1 < r) {
        ll m = (l + r) / 2;
        (p(m) ? r : l) = m;
    }
    return r; // = min { x | p(x) }
}

int main(void){
    ll n, a, b;
    cin >> n >> a >> b;

    vector<ll> h(n);
    rep(i, 0, n){
        cin >> h[i];
    }

    ll result = binsearch(0, *whole(max_element, h) + 1, [&](ll m) {
        ll cnt = 0;
        rep (i, 0, n) {
            ll x = h[i] - m * b;
            if (x >= 0) {
                cnt += (x + a-b-1) / (a-b);
            }
        }
        return cnt <= m;
    });

    cout << result << endl;
    return (n)}


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

import java.util.Scanner;
public class mamono {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        long A = scan.nextInt();
        long B = scan.nextInt();

        long l = 0;
        long r = 1000000001;

        long h[] = new long[N];

        for (int i = 0; i < N; i++) {
            h[i] = scan.nextInt();
        }

        while (l < r - 1) {
            long m = (l + r) / 2;
            long temp[] = h;
            for (int i = 0; i < N; i++) {
                temp[i] -= B * m;
            }
            int x = 0;
            for (int i = 0; i < N; i++) {
                if (temp[i] > 0) {
                    if (temp[i] % (A - B) == 0) {
                        x += temp[i] / (A - B);
                    } else {
                        x += (temp[i] / (A - B)) + 1;
                    }
                }
            }
            if (x > m)
                l = m;
            else
                r = m;

        }

        System.out.println(r+1);
    }
}



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

#include<iostream>
#include<algorithm>
#include<vector>
#include<climits>
using namespace std;
int a,b;
bool check(vector<int>vec,int target,int n);
int main(){
  int n;
  vector<int>vec;
  cin>>n;
  cin>>a>>b;
  for(int i;i<n;i++){
    int data;
    cin>>data;
    vec.push_back(data);
  }
  
  sort(vec.begin(),vec.end());
  int left=1;
  int right=INT_MAX-5;
  int target=(left+right)/2;
  while(left+1<right){
    if(check(vec,target,n)==true){
      right=target;
    }else{
      left=target;
    }
    target=(left+right)/2;
  }
  
  cout<<right<<endl;
  return(0);
}

bool check(vector<int>vec,long long target,int n){
  long long c=a-b;
  long long cnt=0;
  for(int i=0;i<n;i++){
    if((long long)vec[i]-(long long)b*(long long)target>0){
      cnt+=((long long)vec[i]-(long long)b*(long long)target+c-1)/(long long)c;
    }
  }
  if(cnt<=target){
    return(true);
  }
  return(false);
}


Compiler output:
/usr/bin/ld: /tmp/ccZ6Ynoo.o: in function `main':
a.cc:(.text+0xff): undefined reference to `check(std::vector<int, std::allocator<int> >, int, int)'
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<climits>
using namespace std;
int a,b;
bool check(vector<int>vec,int target,int n);
int main(){
  int n;
  vector<int>vec;
  cin>>n;
  cin>>a>>b;
  for(int i;i<n;i++){
    int data;
    cin>>data;
    vec.push_back(data);
  }
  
  sort(vec.begin(),vec.end());
  int left=1;
  int right=INT_MAX-5;
  int target=(left+right)/2;
  while(left+1<right){
    if(check(vec,target,n)==true){
      right=target;
    }else{
      left=target;
    }
    target=(left+right)/2;
  }
  
  cout<<right<<endl;
  return(0);
}

bool check(vector<int>vec,long long target,int n){
  int c=a-b;
  long long cnt=0;
  for(int i=0;i<n;i++){
    if((long long)vec[i]-(long long)b*(long long)target>0){
      cnt+=((long long)vec[i]-(long long)b*(long long)target+c-1)/(long long)c;
    }
  }
  if(cnt<=target){
    return(true);
  }
  return(false);
}


Compiler output:
/usr/bin/ld: /tmp/ccIepMPF.o: in function `main':
a.cc:(.text+0xff): undefined reference to `check(std::vector<int, std::allocator<int> >, int, int)'
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<climits>
using namespace std;
long long int a,b;
bool check(vector<long long>vec,int target,int n);
int main(){
  int n;
  vector<long long>vec;
  cin>>n;
  cin>>a>>b;
  for(int i;i<n;i++){
    int data;
    cin>>data;
    vec.push_back(data);
  }
  
  sort(vec.begin(),vec.end());
  int left=1;
  int right=INT_MAX-5;
  int target=(left+right)/2;
  while(left+1<right){
    if(check(vec,target,n)==true){
      right=target;
    }else{
      left=target;
    }
    target=(left+right)/2;
  }
  
  cout<<right<<endl;
  return(0);
}

bool check(vector<long long>vec,long long target,int n){
  long long c=a-b;
  long long cnt=0;
  for(int i=0;i<n;i++){
    if(vec[i]-b*target>0){
      cnt+=(vec[i]-b*target+c-1)/c;
    }
  }
  if(cnt<=target){
    return(true);
  }
  return(false);
}

Compiler output:
/usr/bin/ld: /tmp/cc5vyBue.o: in function `main':
a.cc:(.text+0x108): undefined reference to `check(std::vector<long long, std::allocator<long long> >, int, int)'
collect2: error: ld returned 1 exit status
Language: Java

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

import java.util.*;

public class Main {
    static int N;
    static int A;
    static int B;
    static int[] h;
    public static boolean isOK(int index) {
        long[] h_2 = new long[N];
        for (int i=0;i<N;i++) {
            h_2[i] = h[i];
            h_2[i] -= (long)B*index;
        }
        for (int i=0;i<N;i++) {
            if (h_2[i]>0) {
                index -= (h_2[i]+(A-B-1))/(A-B);
            }
        }
        if (index>=0) return true;
        else return false;
    }

    public static long binary_search() {
        long left = -1;
        long right = Integer.MAX_VALUE-100;

        while (right - left > 1) {
            long mid = left + (right - left) / 2;

            if (isOK(mid)) right = mid;
            else left = mid;
        }
        return right;
    }
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);

        N = in.nextInt();
        A = in.nextInt();
        B = in.nextInt();
        h = new int[N];
        for (int i=0;i<N;i++) {
            h[i] = in.nextInt();
        }

        out.println(binary_search());

        out.close();
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

    }
}


Compiler output:
Main.java:39: error: incompatible types: possible lossy conversion from long to int
            if (isOK(mid)) right = mid;
                     ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
Language: C++

#include <bits/stdc++.h>
#define rep(i,a,b) for(ll i=ll(a);i<ll(b);i++)
#define S .second 
using ll=long long;
using namespace std;
ll h[110000];
int main(){
    ll n,a,b,c,sum=0,tmp,ans=1e10;
    cin>>n>>a>>b;
    rep(i,0,n){cin>>h[i];sum+=h[i];}
    c=a-b;
    sort(h,h+n);
    ll l=0,r=h[n-1];
    while(l<r){
      tmp=ceil((ld)l+r)/2;
      if(sum<=tmp*b*n+tmp*c){
        ans=min(ans,tmp);
        r=tmp-1;
      }
      else l=tmp+1;
    }
    cout<<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: 'ld' was not declared in this scope; did you mean 'l'?
   15 |       tmp=ceil((ld)l+r)/2;
      |                 ^~
      |                 l
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007 

ll h[100010];
int main() {
	ll n,a,b;
	cin>>n>>a>>b;
	for(ll i=0;i<n;i++){
		cin>>h[i];
	}
	ll left=1,right=10000,00000,00001;
    while (right - left > 1) {
        ll mid = left + (right - left) / 2; // 区間の真ん中
        bool ch=false;
        ll x=0;
        for(ll i=0;i<n;i++){
        	x+=max(ll(0),(h[i]-mid*b+(a-b)-1)/(a-b));
        }
        if(mid>=x){
        	ch=true;
        }
        //cout << mid <<endl;
        /* 回答の応じて、年齢を絞る */
        if (ch!=true) left = mid; // mid 歳以上なら、mid 歳以上 right 歳以下になるように
        else right = mid; // mid 歳未満なら、left 歳以上 mid 歳未満になるように
    }
    cout <<right;
	// your code goes here
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:31: error: expected unqualified-id before numeric constant
   14 |         ll left=1,right=10000,00000,00001;
      |                               ^~~~~
Language: C++

#include<bits/stdc++.h>

using namespace std;

int main{
  int N,A,B;
  cin>>N>>A>>B;
  vector<long long> h(N);
  for(int i=0;i<N;++i)cin>>h[i];
  long long l=0,r=1LL<<48;
  while(l+1!=r){
    long long c=(l+r)/2,need=0;
    for(int i=0;i<N;++i)need+=max(0LL,h[i]-B*c+A-B-1)/(A-B);
    if(need<=c)
      r=c;
    else
      l=c;
  }
  cout<<r<<endl;
  return 0;
}

Compiler output:
a.cc:5:5: error: cannot declare '::main' to be a global variable
    5 | int main{
      |     ^~~~
a.cc:6:3: error: expected primary-expression before 'int'
    6 |   int N,A,B;
      |   ^~~
a.cc:6:3: error: expected '}' before 'int'
a.cc:5:9: note: to match this '{'
    5 | int main{
      |         ^
a.cc:7:3: error: 'cin' does not name a type
    7 |   cin>>N>>A>>B;
      |   ^~~
a.cc:8:23: error: 'N' was not declared in this scope
    8 |   vector<long long> h(N);
      |                       ^
a.cc:9:3: error: expected unqualified-id before 'for'
    9 |   for(int i=0;i<N;++i)cin>>h[i];
      |   ^~~
a.cc:9:15: error: 'i' does not name a type
    9 |   for(int i=0;i<N;++i)cin>>h[i];
      |               ^
a.cc:9:19: error: expected unqualified-id before '++' token
    9 |   for(int i=0;i<N;++i)cin>>h[i];
      |                   ^~
a.cc:11:3: error: expected unqualified-id before 'while'
   11 |   while(l+1!=r){
      |   ^~~~~
a.cc:19:3: error: 'cout' does not name a type
   19 |   cout<<r<<endl;
      |   ^~~~
a.cc:20:3: error: expected unqualified-id before 'return'
   20 |   return 0;
      |   ^~~~~~
a.cc:21:1: error: expected declaration before '}' token
   21 | }
      | ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define MP make_pair
#define PB push_back
#define F first
#define S second
#define FOR(i, a, b) for(int i = a; i <= (b); i++)
#define all(x) x.begin(), x.end()

typedef pair<int, int> pi;
typedef long long ll;
const int INF = 2000000000;

vector<int> health;
int N, A, B;

bool valid(int exp)
{
  vector<int> tmp(health);
  FOR(i, 0, N - 1)
    health[i] -= exp * B;
  
  int necessary = 0;
  FOR(i, 0, N - 1)
  {
    necessary += max(0, ceil(tmp[i] / (A - B)));
  }
  
  return necessary <= exp;
}

int main()
{
  cin >> N >> A >> B;
  health.resize(N);
  FOR(i, 0, N - 1)
    cin >> health[i];
  
  int x = -1;
  for (int b = 1e9; b >= 1; b /= 2) 
  {
	while (!valid(x + b)) 
      x += b;
  }
  int ans = x + 1;
  
  cout << ans;

  return 0;
}


Compiler output:
a.cc: In function 'bool valid(int)':
a.cc:28:21: error: no matching function for call to 'max(int, __gnu_cxx::__enable_if<true, double>::__type)'
   28 |     necessary += max(0, ceil(tmp[i] / (A - B)));
      |                  ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
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:28:21: note:   deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__enable_if<true, double>::__type' {aka 'double'})
   28 |     necessary += max(0, ceil(tmp[i] / (A - B)));
      |                  ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:28:21: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   28 |     necessary += max(0, ceil(tmp[i] / (A - B)));
      |                  ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF (1ll << 60)
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;
typedef pair<ll, ll> p;
constexpr int MOD = 1000000007;
using ll = long long;
template <class T> inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

void print(const std::vector<ll> &v) {
    std::for_each(v.begin(), v.end(), [](ll x) { std::cout << x << " "; });
    std::cout << std::endl;
}
int N, A, B;
vector<ll> h;

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

// 汎用的な二分探索のテンプレ
int binary_search(vector<ll> t) {
    ll ng = -1LL; //「index = 0」が条件を満たすこともあるので、初期値は -1
    ll ok = INF;

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

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

int main() {
    cin >> N >> A >> B;
    // A > B
    vector<ll> h;
    h.resize(N);
    REP(i, N) { cin >> h[i]; }
    cout << binary_search(h) << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int binary_search(std::vector<long long int>)':
a.cc:57:16: error: too many arguments to function 'bool isOK(ll)'
   57 |         if(isOK(mid, t))
      |            ~~~~^~~~~~~~
a.cc:35:6: note: declared here
   35 | bool isOK(ll t) {
      |      ^~~~
Language: C++

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

bool enough(vector<int> &h, int t, int a, int b){
	int need = 0;
	for(auto hi: h){
		if(hi > b * t) {
			need += (hi - b * t + (a - b  - 1)) / (a - b);
		}
	}
	if(need <= t) return true;
	else return false;
	return true;
}

int bin(vector<int> &h, int min, int max, int a, int b){
	int mid = (min + max) / 2;
	if (mid == min) return max;
	if(enough(h, mid, a, b))
		return bin(h, min, mid, a, b);
	else
		return bin(h, mid, max, a, b);
}

int main(){
	int n, a, b, h_tmp;
	int h_max = INT_MIN;
	int h_max_index;
	int h_max_index_tmp;
	int count = 0;
	cin >> n >> a >> b;
	vector<int> h(n);
	for(int i = 0; i < n; i++){
		cin >> h_tmp;
		h[i] = h_tmp;
	}
	cout << bin(h, t / a - 1, (t + b - 1)/ b, a, b);
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:39:24: error: 't' was not declared in this scope
   39 |         cout << bin(h, t / a - 1, (t + b - 1)/ b, a, b);
      |                        ^
Language: C++

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

int main(){
	int n, a, b, h_tmp;
	int vector<int> h;
	int h_max = INT_MIN;
	int h_max_index;
	int count = 0;
	cin >> n >> a >> b;
	for(int i = 0; i < n; i++){
		cin >> h_tmp;
		h[i] = h_tmp;
		if(h_tmp > h_max) {
			h_max = h_tmp;
			h_max_index = i;
		}
	}
	while(h_max > 0){
		count++;
		h_max = INT_MIN;
		for(int i = 0; i < n; i++) {
			if(i == h_max_index) {
				h[i] -= a;
			} else {
				h[i] -= b;
			}
			if(h[i] > h_max) {
				h_max = h[i];
				h_max_index = i;
			}
		}
	}
	cout << count;
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:8:25: error: invalid declarator before 'h'
    8 |         int vector<int> h;
      |                         ^
a.cc:15:17: error: 'h' was not declared in this scope
   15 |                 h[i] = h_tmp;
      |                 ^
a.cc:26:33: error: 'h' was not declared in this scope
   26 |                                 h[i] -= a;
      |                                 ^
a.cc:28:33: error: 'h' was not declared in this scope
   28 |                                 h[i] -= b;
      |                                 ^
a.cc:30:28: error: 'h' was not declared in this scope
   30 |                         if(h[i] > h_max) {
      |                            ^