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

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>//sort,reverse
#include<utility>//pair
#include<queue>//queue,priority queue
#include<deque>//double_ended queue
using namespace std;
int main()
{ 
    int n;
    long long int k;
    cout<<LLONG_MAX<<endl;
    cin>>n>>k;
    if(k>1000000000000){
        k=1000000000000;
    }
    long long int a[n],f[n];
    for(int i=0;i<n;i++){
        cin>>a[i];//消化コスト
    }
    for(int i=0;i<n;i++){
        cin>>f[i];//食べにくさ
    }
    sort(a,a+n);
    sort(f,f+n);
    reverse(f,f+n);
    pair<long long int,long long int>p;
    priority_queue< pair<long long int,long long int> > v;
    for(int i=0;i<n;i++){
        p.first=a[i]*f[i];
        p.second=f[i];
        v.push(p);
    }
    long long int order=0;
    while(k>0){
        if(k>=200000){
            order=k/100000;
            p=v.top();
            v.pop();
            p.first=p.first-p.second*order;
            k=k-order;
        }
        else{
            p=v.top();
            v.pop();
            p.first=p.first-p.second;
            v.push(p);
            k--;
        }
    }
    p=v.top();
    if(p.first<0){
        p.first=0;
    }
    cout<<p.first<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:11: error: 'LLONG_MAX' was not declared in this scope
   13 |     cout<<LLONG_MAX<<endl;
      |           ^~~~~~~~~
a.cc:7:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    6 | #include<queue>//queue,priority queue
  +++ |+#include <climits>
    7 | #include<deque>//double_ended queue
Language: C++

// #include "./bits/stdc++.h"

#include <vector>
#include <iostream>

using namespace std;

/*
vector.push_back()
vector<int> hoge(3,-1); {-1,-1,-1}
vector<vector<int>> hogehoge(2,vector<int>(2,-1)); {{-1,-1},{-1,-1}} 
cin >>temp;
scanf("%d %d %d",&A,&B,&Q);
sort(a.begin(),a.end());
a.push_back(4000000000000);
a.insert(a.begin(),-1000000000000);
upper_bound(a.begin(),a.end(),x); // list[i] > x のイテレータ取得. *itrで数値化 
    std::priority_queue<
      int,
      std::vector<int>,
      decltype(compare) // 比較関数オブジェクトを指定
    > que(comp);
*/
template <typename T> void debug(T arr);
template <typename T> void debug (T arr, int dim);


bool possible(vector<long long> &a,vector<long long> &f,int k,long long border){
    // cout << "in pos" << endl;
    // cout << border << endl;
    long long count = 0;
    int n = a.size();
    for (int i = 0; i < n; ++i){
        long long buf = a[i]*f[i];
        if (buf > border){
            long long sup = buf-border;
            if (sup % f[i] == 0){
                count += sup/f[i];
            }else{
                count += sup/f[i] + 1;
            }
        }
    }
    // cout << count << endl;
    if (count <= k){
        return true;
    }else{
        return false;
    }
}

int main(void){
    int n,k;

    cin >> n >> k;

    vector<long long> a(n);
    vector<long long> f(n);
    for (int i = 0; i < n; ++i){
        scanf("%lld",&a[i]);
    }

    for (int i = 0; i < n; ++i){
        scanf("%lld",&f[i]);
    }

    sort(a.begin(),a.end());
    sort(f.begin(),f.end());
    reverse(f.begin(),f.end());

    long long abo = a[n-1]*f[n-1];

        long long left = 0;
        long long right = abo;

        while (right-left >= 10){
            long long middle = (right+left)/2;
            bool mp = possible(a,f,k,middle);
            if (mp){
                right = middle;
            }else{
                left = middle;
            }
        }
        long long ans = 10000000000000000;
        for (int i = right; i >= left; --i){
            if (possible(a,f,k,i)){
                ans = i;
            }
        }
        cout << ans << endl;

};


template <typename T> void debug(T arr){
    for (auto col:arr){
        cout << col << " ";
    }
    cout <<endl;
};

template <typename T> void debug (T arr, int dim){
    for (auto raw:arr){
        for(auto col:raw){
            cout << col << " ";
        }
        cout << endl;
    }
};


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

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

#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rept(i,k,n) for(int i = (k); i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define Sort(v) sort(v.begin(),v.end())
#define Reverse(v) reverse(v.begin(),v.end())

typedef long long ll;
typedef pair<int,int> Pii;
typedef pair<long long,long long> Pdd;

int main() {
    ll n,k;cin>>n>>k;
    vector<ll> a(n),f(n);
    rep(i,n) cin>>a[i];
    rep(i,n) cin>>f[i];
    Sort(f);Sort(a);Reverse(f);
    vector<Pdd> af(n);
    rep(i,n)  af[i]=Pdd(a[i]*f[i],f[i]);
    ll l=0,r=2e12;
    int cnt=0;
    while(cnt!=100){
        cnt++;
        ll mid=(l+r)/2;
        ll sum=0;
        rep(i,n){
            if(af[i].first>mid){
                sum+=(af[i].first-mid-1)/af[i].second+1;
            }
        }
        if(sum>k){
            l=mid;
        }
        else if(sum<=k){
            r=mid;
        }
    }
    r=min(0,r-500ll);
    while(1){
        ll sum=0;
        rep(i,n){
        if(af[i].first>r){
            sum+=(af[i].first-r-1)/af[i].second+1;
            }
        }
        if(sum<=k){cout<<r<<endl;return 0;}
        r++;   
    }
        
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:10: error: no matching function for call to 'min(int, ll)'
   40 |     r=min(0,r-500ll);
      |       ~~~^~~~~~~~~~~
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:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:40:10: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   40 |     r=min(0,r-500ll);
      |       ~~~^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281: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:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:40:10: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   40 |     r=min(0,r-500ll);
      |       ~~~^~~~~~~~~~~
Language: C++

#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#include<boost/range/adaptors.hpp>
#include<boost/operators.hpp>
#include<boost/dynamic_bitset.hpp>

namespace adaptor = boost::adaptors;
using index_t = std::size_t;
	
void Main()
{
	int N;
	std::int64_t K;
	std::cin >> N >> K;
	std::vector<std::int64_t> member(N);
	std::vector<std::int64_t> food(N);
	for (auto& m : member)
	{
		std::cin >> m;
	}
	for (auto& f : food)
	{
		std::cin >> f;
	}
	boost::sort(member);
	boost::sort(food, std::greater<>());
	std::int64_t min = -1;
	std::int64_t max = food.front() * member.back() + 1;
	while (max - min > 1)
	{
		auto mid = (min + max) / 2;
		std::int64_t count = 0;
		for (auto i : boost::irange(0, N))
		{
			count += std::max(0LL, member[i] - mid / food[i]);
		}
		if (count <= K)
		{
			max = mid;
		}
		else
		{
			min = mid;
		}
	}
	std::cout << max << std::endl;
}

int main()
{
	std::cin.tie(nullptr);
	std::ios_base::sync_with_stdio(false);
	std::cout << std::fixed << std::setprecision(15);
	Main();
}

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

#include <cstdio>
#include <algorithm>

typedef long long int ll;

const int MAXN = 3e5 + 10;

struct T {
    int fx; ll wt;
    T(int _fx = 0, ll _wt = 0) { fx = _fx; wt = _wt; }
    bool operator < (const T &that) const {
        return wt == that.wt ? fx > that.fx : wt > that.wt;
    }
} ss[MAXN];

int n, k;
ll aa[MAXN], bb[MAXN];

bool check(ll x) {
    // 二分的是答案（最大值）
    ll cnt = 0;
    for (int i = 1; i <= n; ++i) {
        if (ss[i].wt <= x) return true;
        int idx = ss[i].fx;
        ll dd = (aa[idx] * bb[idx] - x + bb[idx] - 1ll) / bb[idx];
        if (dd > aa[idx]) return false;
        cnt += dd;
        if (cnt > k) return false;
    }
    return true;
}

int main() {
    scanf("%d %d", &n, &k);
    for (int i = 1; i <= n; ++i) scanf("%lld", aa + i);
    for (int i = 1; i <= n; ++i) scanf("%lld", bb + i);
    std::sort(aa + 1, aa + 1 + n);
    std::sort(bb + 1, bb + 1 + n, std::greater<int>());
    for (int i = 1; i <= n; ++i) ss[i] = ((T) { i, 1ll * aa[i] * bb[i] } );
    std::sort(ss + 1, ss + 1 + n);
    ll l = 0, r = ss[1].wt, ans = 0;
    while (l <= r) {
        ll mid = (l + r) >> 1;
        if (check(mid)) {
            ans = mid; r = mid - 1;
        } else l = mid + 1;
    }
    printf("%lld\n", ans);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:40: error: 'greater' is not a member of 'std'
   38 |     std::sort(bb + 1, bb + 1 + n, std::greater<int>());
      |                                        ^~~~~~~
a.cc:38:48: error: expected primary-expression before 'int'
   38 |     std::sort(bb + 1, bb + 1 + n, std::greater<int>());
      |                                                ^~~
Language: C++

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

int main() {
 long long int N,K;
 cin>>N>>K;
 vector<long long int> A(N), F(N);
 vector<pair<long long int, pair<long long int, long long int>>> B(N);
 for(int i=0;i<N;i++) cin>>A[i];
 for(int i=0;i<N;i++) cin>>F[i];
 sort(A.begin(), A.end());
 sort(F.begin(), F.end(), greater<long long int>());
 long long int lower = 0, upper = 1e12;
 while(lower < upper){
   long long int mid = (lower + upper) / 2;
   long long int tmp = 0;
   for(int i=0;i<N;i++){
     tmp += max(0, (A[i] - mid/F[i]));
   }
   if(tmp <= K){
     upper = mid;
   }
   else{
     lower = mid + 1;
   }
 }
 cout<<lower<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:16: error: no matching function for call to 'max(int, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type)'
   18 |      tmp += max(0, (A[i] - mid/F[i]));
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~
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:16: 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'})
   18 |      tmp += max(0, (A[i] - mid/F[i]));
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~
/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:16: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   18 |      tmp += max(0, (A[i] - mid/F[i]));
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
using namespace std;

#define ll long long
#define maxv 1000000000000
#define maxn 200000

int n;
ll k;
ll a[maxn],f[maxn];

int check(ll m){
    ll c=0,temp;
    for(int i=0;i<n;i++){
        temp=m/f[i];
        if(temp<a[n-1-i]){
            c+=a[n-1-i]-temp;
        }
    }
    if(c<=k) return 1;
    else return 0;
}

int main() {
    cin>>n>>k;
    for(int i=0;i<n;i++) cin>>a[i];
    for(int i=0;i<n;i++) cin>>f[i];
    sort(a,a+n);
    sort(f,f+n);
    ll l=0,r=maxv,m,ans;
    while(l<=r){
        m=(l+r)/2;
        if(check(m)){
            ans=m;
            r=m-1;
        }
        else l=m+1;
    }
    m=(l+r)/2;
    if(check(m)) ans=m;
    cout<<ans<<"\n";
    return 0;
}

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

#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <queue>
#define int long long
#define mp(x,y) make_pair(x,y)
using namespace std;
void file(){
    freopen("read.in","r",stdin);
    freopen("write.out","w",stdout);
}
const int N=500010;
inline int read(){
    int sym=0,res=0;char ch=0;
    while (!isdigit(ch))sym|=(ch=='-'),ch=getchar();
    while (isdigit(ch)) res=(res<<3)+(res<<1)+(ch^48),ch=getchar();
    return sym?-res:res;
}
struct node{
    int a,b;
}dat[N];
int n,m,a[N],b[N];
priority_queue<pair<int,int> >q;
bool cmp(int a,int b){
    return a>b;
}
int main(){
    n=read();int k=read();
    for (int i=1;i<=n;i++)a[i]=read();
    for (int i=1;i<=n;i++)b[i]=read();
    sort(a+1,a+n+1);
    sort(b+1,b+n+1,cmp);
    for (int i=1;i<=n;i++){
        dat[i].a=a[i],dat[i].b=b[i],q.push(mp(a[i]*b[i],i));
    }
    while (k--){
        int x=q.top().second;q.pop();
        dat[x].a--;q.push(mp(dat[x].a*dat[x].b,x));
    }
    int ans=0;
    for (int i=1;i<=n;i++){
        ans=max(ans,dat[i].a*dat[i].b);
    }
    printf("%d",ans);
    return 0;
}

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

#include <bits/stdc++.h>
#define ll long long
using namespace std;
void read(int &x){
	char c;x=0;int b=1;do{c=getchar();if(c==45)b=-1;}while(c>57||c<48);
	do x=x*10+c-48,c=getchar();while(c<=57&&c>=48);x*=b;
}
void read(ll &x){
	char c;x=0;int b=1;do{c=getchar();if(c==45)b=-1;}while(c>57||c<48);
	do x=x*10+c-48,c=getchar();while(c<=57&&c>=48);x*=b;
}
ll a[200010],f[200010];
ll i,j,k,n,m;
bool cmp(ll a,ll b){return a>b;}
bool check(ll x){
	ll K=k;
	for(i=1;i<=n;i++){
		ll NEED=x/f[i];
		K-=max(0,a[i]-NEED);
		if(K<0)return false;
	}
	return true;
}
int main() {
	cin>>n>>k;
	for(i=1;i<=n;i++)
		read(a[i]);
	for(i=1;i<=n;i++)
		read(f[i]);
	sort(a+1,a+1+n);
	sort(f+1,f+1+n,cmp);
	ll L=0,R=1e6;
	while(R>=L){
		ll mid=L+R>>1;
		if(check(mid))R=mid-1;
		else L=mid+1;
	}cout<<R+1<<endl;
	//cerr << 1.0*clock()/CLOCKS_PER_SEC << endl;
	return 0;
}


Compiler output:
a.cc: In function 'bool check(long long int)':
a.cc:19:23: error: no matching function for call to 'max(int, long long int)'
   19 |                 K-=max(0,a[i]-NEED);
      |                    ~~~^~~~~~~~~~~~~
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:19:23: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   19 |                 K-=max(0,a[i]-NEED);
      |                    ~~~^~~~~~~~~~~~~
/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:19:23: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   19 |                 K-=max(0,a[i]-NEED);
      |                    ~~~^~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<bits/stdc++.h>
#include<string>
using namespace std;
int main()
{
  int n , k;
  cin >> n >> k ;
  
  vector<int> a(n) ;
  vector<int> f(n) ;

  for(int i=0;i<n;i++){
     cin >> a[i] ;
  }  
  for(int i=0;i<n;i++){
    cin >> f[i] ;
  }  
  
  if(sum(a)<=k){
    cout << 0 << endl ;
    return 0 ;
  }
    
  
  sort(a.begin(),a.end(),greater<int>())
  sort(f.begin(),f.end(),greater<int>())


 int cnt = 0 ;
 for(int i=0;i<k;i++){
   for(int j=0;j<a[i];j++){
     --a[j] ;
     cnt ++ ;
     if(cnt==k){
       break ;
     }
   }
   if(cnt==k){
     break ;
   }
  }
 
 int ans = 0 ;
  for(int i=0;i<n;i++){
    ans+= a[i]*f[i] ;
  }
  
  cout << ans << endl ;
  return 0 ;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:6: error: 'sum' was not declared in this scope
   20 |   if(sum(a)<=k){
      |      ^~~
a.cc:26:41: error: expected ';' before 'sort'
   26 |   sort(a.begin(),a.end(),greater<int>())
      |                                         ^
      |                                         ;
   27 |   sort(f.begin(),f.end(),greater<int>())
      |   ~~~~                                   
a.cc:34:6: error: 'cnt' was not declared in this scope; did you mean 'int'?
   34 |      cnt ++ ;
      |      ^~~
      |      int
a.cc:39:7: error: 'cnt' was not declared in this scope; did you mean 'int'?
   39 |    if(cnt==k){
      |       ^~~
      |       int
Language: C++

#include <bits/stdc++.h>

int N;
int64_t K;
std::vector<int64_t> A, F;

bool able(int64_t);

int main()
{
	scanf("%d%lld", &N, &K);
	A.resize(N);
	F.resize(N);
	for (auto& e: A) scanf("%lld", &e);
	for (auto& e: F) scanf("%lld", &e);
	std::sort(A.rbegin(), A.rend());
	std::sort(F.begin(), F.end());
	int64_t ng{-1}, ok{1ll << 60};
	while (ok - ng > 1)
	{
		int64_t mid{(ok + ng) >> 1};
		if (able(mid)) ok = mid;
		else ng = mid;
	}
	printf("%lld\n", ok);

	return 0;
}

bool able(int64_t score)
{
	int64_t cost{};
	for (int i{}; i < N; i++)
		cost += std::max(0ll, A[i] - score / F[i]);
	return cost <= K;
}

Compiler output:
a.cc: In function 'bool able(int64_t)':
a.cc:34:33: error: no matching function for call to 'max(long long int, __gnu_cxx::__alloc_traits<std::allocator<long int>, long int>::value_type)'
   34 |                 cost += std::max(0ll, A[i] - score / F[i]);
      |                         ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
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:34:33: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and '__gnu_cxx::__alloc_traits<std::allocator<long int>, long int>::value_type' {aka 'long int'})
   34 |                 cost += std::max(0ll, A[i] - score / F[i]);
      |                         ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/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:34:33: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   34 |                 cost += std::max(0ll, A[i] - score / F[i]);
      |                         ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <limits.h>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <queue>
#include <map>
#include <set>
#include <iomanip>
#include <bitset>
#include <cassert>
#include <random>
#include <functional>
#include <stack>
#include <iomanip>
#include <cassert>
using namespace std;
long long MOD = 1e9 + 7; #include <iostream>
#include <vector>
#include <limits.h>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <queue>
#include <map>
#include <set>
#include <iomanip>
#include <bitset>
#include <cassert>
#include <random>
#include <functional>
#include <stack>
#include <iomanip>
#include <cassert>
using namespace std;
long long MOD = 1e9 + 7;

vector<long long> A, F;
int N, K;

bool judge(long long time) {
	long long k = K;
	for (int n = 0; n < N; n++) {
		if (A[n] * F[n] <= time)continue;
		long long needed = floor((long double)time / F[n]);
		k -= (A[n] - needed);
		if (k < 0)return false;
	}
	return true;
}

int main() {
	cin >> N >> K;
	A.resize(N);
	F.resize(N);
	for (int n = 0; n < N; n++)cin >> A[n];
	for (int n = 0; n < N; n++)cin >> F[n];
	sort(A.begin(), A.end(), [](long long a, long long b) {
		return a < b;
	});
	sort(F.begin(), F.end(), [](long long a, long long b) {
		return a > b;
	});
	long long s = -1, e = LLONG_MAX - 1;
	while (e - s > 1) {
		long long m = (e + s) / 2;
		if (judge(m))e = m;
		else s = m;
	}
	cout << e << endl;
	return 0;
}


long long N;
int main() {
	cin >> N;
	long long ans = LLONG_MAX;
	for (long long n = 1; n * n <= N; n++) {
		if (N % n != 0)continue;
		ans = min(ans, (n + N / n) - 2);
	}
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc:20:26: error: stray '#' in program
   20 | long long MOD = 1e9 + 7; #include <iostream>
      |                          ^
a.cc:20:27: error: 'include' does not name a type
   20 | long long MOD = 1e9 + 7; #include <iostream>
      |                           ^~~~~~~
a.cc:39:11: error: redefinition of 'long long int MOD'
   39 | long long MOD = 1e9 + 7;
      |           ^~~
a.cc:20:11: note: 'long long int MOD' previously defined here
   20 | long long MOD = 1e9 + 7; #include <iostream>
      |           ^~~
a.cc:78:11: error: conflicting declaration 'long long int N'
   78 | long long N;
      |           ^
a.cc:42:5: note: previous declaration as 'int N'
   42 | int N, K;
      |     ^
a.cc:79:5: error: redefinition of 'int main()'
   79 | int main() {
      |     ^~~~
a.cc:55:5: note: 'int main()' previously defined here
   55 | int main() {
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll=int_fast64_t;
#define fr(i,n) for(int i=0;i<(n);++i)
#define Fr(i,n) for(int i=1;i<=(n);++i)
#define ifr(i,n) for(int i=(n)-1;i>=0;--i)
#define iFr(i,n) for(int i=(n);i>0;--i)

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    istream& in(cin);
    ostream& out(cout);
    int n;
    ll k;
    in>>n>>k;
    vector<int> a(n),f(n);
    for(auto&i:a) in>>i;
    for(auto&i:f) in>>i;
    sort(a.begin(),a.end());
    reverse(a.begin(),a.end());
    sort(f.begin(),f.end());
    ll l=-1,r=1e18,m;
    while(r-l>1){
        m=(l+r)>>1;
        ll s=0;
        fr(i,n) s+=max(0ll,a[i]-m/f[i]);
        if(s>k) l=m;
        else r=m;
    }
    cout<<r<<endl;
}

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

#include<bits/stdc++.h>
using namespace std;
typedef double db;
int main () {
  int N, M;
  cin >> N >> M;
  vector<db>E(N + 1);
  vector<db>P(N + 1, 0);
  vector<vector<int>>dag(N + 1);
  for (int i = 0; i < M; i ++) {
    int s, t;
    cin >> s >> t;
    dag[s].puah_back(t);
  }
  P[1] = 1;
  for (int i = 1; i < N; i ++) {
    int s = (int)dag[i].size();
    for (int j = 0; j < s; j ++) {
      P[dag[i][j]] += (P[i] / s);
    }
  }
  E[N] = 0;
  for (int i = N - 1; i >= 1; i --) {
    int s = (int)dag[i].size();
    db kj = 0;
    for (int j = 0; j < s; j ++) {
      kj += E[dag[i][j]];
    }
    kj /= s;
    E[i] = kj + 1;
  }
  db ans = E[1];
  for (int i = 1; i < N; i ++) {
    int s = dag[i].size();
    if (s == 1) continue;
    for (int j = 0; j < s; j ++) {
      db moto = E[i] * s;
      db dis = ((moto - E[dag[i][j]]) / (s - 1)) - E[i];
      db kj = E[1] + (dis * P[i]);
      if (ans > kj) ans = kj;
    }
  }
  cout << setprecision(10) << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:12: error: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'class std::vector<int>'} has no member named 'puah_back'; did you mean 'push_back'?
   13 |     dag[s].puah_back(t);
      |            ^~~~~~~~~
      |            push_back
Language: C

#include <iostream>
#include<math.h>
#include<algorithm>
using namespace std;
#define LL long long
const int maxn = 1e6 + 5;
int N;
LL A[maxn], F[maxn];
LL K, sum;
bool ifnot(LL x)
{
    LL ue=0;
    for(int i=0;i<N;i++)
    {
        if(A[i]*F[i]<=x)
            continue;
        else
        {
            LL se=x/F[i];
            ue+=A[i]-se;
        }
    }
    if(ue<=K)
        return true;
    else
        return false;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> N >> K;
    for (int i = 0; i < N; i++)
    {
        cin >> A[i];
        sum += A[i];
    }
    for (int i = 0; i < N; i++)
    {
        cin >> F[i];
    }
    sort(A,A+N);
    sort(F, F + N,greater<LL>());
    if (sum <= K)
    {
        cout << 0 << "\n";
        return 0;
    }
    else
    {
        LL l=0,r=1e12,m,result=0;
        while(l<=r){
            m=(r-l)/2+l;
            if(ifnot(m))
                r=m-1,result=m;
            else
                l=m+1;
        }
        cout<<result<<"\n";
    }
    return 0;
}


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

#include <bits/stdc++.h>
using namespace std;
#define LL long long
const int maxn = 1e6 + 5;
int N;
LL A[maxn], F[maxn];
LL K, sum;
bool ifnot(LL x)
{
    LL ue=0;
    for(int i=0;i<N;i++)
    {
        if(A[i]*F[i]<=x)
            continue;
        else
        {
            LL se=x/F[i];
            ue+=A[i]-se;
        }
    }
    if(ue<=K)
        return true;
    else
        return false;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> N >> K;
    for (int i = 0; i < N; i++)
    {
        cin >> A[i];
        sum += A[i];
    }
    for (int i = 0; i < N; i++)
    {
        cin >> F[i];
    }
    sort(A,A+N);
    sort(F, F + N,greater<LL>());
    if (sum <= K)
    {
        cout << 0 << "\n";
        return 0;
    }
    else
    {
        LL l=0,r=1e12,m,result=0;
        while(l<=r){
            m=(r-l)/2+l;
            if(ifnot(m))
                r=m-1,result=m;
            else
                l=m+1;
        }
        cout<<result<<"\n";
    }
    return 0;
}


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

#include<bits/stdc++.h>
//ios::sync_with_stdio(false);cin.tie(0);
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<pii,int> ppii;
typedef pair<int,pii> pipi;
typedef pair<ll,ll> pll;
typedef pair<pll,ll> ppll;
typedef pair<ll,pll> plpl;
typedef tuple<ll,ll,ll> tl;
ll mod=1000000007;
ll mod2=998244353;
ll mod3=1000003;
ll mod4=998244853;
ll inf=1000000000000000000;
double pi=2*acos(0);
#define rep(i,m,n) for(ll i=m;i<n;i++)
#define rrep(i,n,m) for(ll i=n;i>=m;i--)
int dh[4]={1,-1,0,0};
int dw[4]={0,0,1,-1};
int ddh[8]={-1,-1,-1,0,0,1,1,1};
int ddw[8]={-1,0,1,-1,1,-1,0,1};
ll lmax(ll a,ll b){
    if(a<b)return b;
    else return a;
}
ll lmin(ll a,ll b){
    if(a<b)return a;
    else return b;
}
ll gcd(ll a,ll b){
    if(a<b)swap(a,b);
    if(b==0)return a;
    if(a%b==0)return b;
    return gcd(b,a%b);
}
ll Pow(ll n,ll k){
    ll ret=1;
    ll now=n;
    while(k>0){
        if(k&1)ret*=now;
        now*=now;
        k/=2;
    }
    return ret;
}

int main(){
    ll n,m;cin>>n>>m;
    vector<pll> v[n+1];
    rep(i,0,m){
        ll s,t;cin>>s>>t;
        v[s].push_back({t,i});
    }
    double ans=1000000000;
    double dpp[n+1];
    fill(dpp,dpp+n+1,0);
    dpp[n]=0;
    rrep(i,n-1,1){
        double cnt=v[i].size();
        
        rep(k,0,v[i].size()){
            
            dpp[i]+=dpp[v[i][k].first]/cnt;
        }
        
        dpp[i]=dpp[i]+1;
    }
    ans=dpp[1];
    rep(i,1,n){
        double dp[n+1];
        fill(dp,dp+n+1,0);
        dp[n]=0;
        ll che=0;
        rrep(j,n-1,1){
           if(j==i){
              if(v[j].size()==1){
                dp[j]=1000000000;
              }
              else{
                double summ=0;
                double maa=0;
                rep(k,0,v[j].size()){
                   ll ne=v[j][k].first;
                  summ+=dp[ne];
                  ma=max(ma,dp[ne]);
                }
                summ-=maa;
                summ/=(double)(v[j].size()-1);
                dp[j]=summ+1;
              }
           }
           else{
             rep(k,0,v[j].size()){
               ll ne=v[j][k].first;
               dp[j]+=dp[ne];
             }
             dp[j]/=(double)(v[j].size());
             dp[j]++;
           }
        }

       
        ans=min(ans,dp[1]);
    }
    cout<<fixed<<setprecision(12)<<ans<<endl;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:88:19: error: 'ma' was not declared in this scope; did you mean 'maa'?
   88 |                   ma=max(ma,dp[ne]);
      |                   ^~
      |                   maa
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<queue>
#include<cmath>

using namespace std;



int main(){
    int n, m;
    cin >> n >> m;
    vector<vector<int>> mp(n, vector<int>());
    vector<vector<int>> rmp(n, vector<int>());
    vector<double> rev(n, 0);// pathcnt, edgetotalcnt
    vector<int> toChoose(n);
    vector<int> S(m), T(m);
    for(int i=0;i<m;i++){
        int s,t;
        cin >> s >> t;
        S[i] = s-1;
        T[i] = t-1;
        mp[S[i]].push_back(i);
        rmp[T[i]].push_back(i);
    }
    rev[n-1] = 0;
    for(int i=n-1;i>=0;i--){
        for(int ne:mp[i]){
            int nei = T[ne];
            rev[i] += rev[nei];
        }
        if(mp[i].size() > 0){
            rev[i] = rev[i] / (double)mp[i].size() + 1;
        }else{
            rev[i] = 0;
        }
        double mx=-1.0;
        for(auto ne:mp[i]){
            int nei = T[ne];
            if(rev[nei] >= mx){
                mx = rev[nei];
                toChoose[i] = ne;
            }
        }
    }
    double scMin = INT_MAX;
    toChoose.push_back(-1);
    for(int i=0;i<=n;i++){
        vector<double> dp(n);
        dp[n-1] = 0.0;
        for(int j=n-2;j>=0;j--){
            int cnt=0;
            double sum=0.0;
            for(int ne:mp[j]){
                int nei = T[ne];
                sum += dp[nei];
                cnt++;
            }
            if(i == j && cnt >= 2 && toChoose[i] != -1){
                sum -= dp[T[toChoose[i]]];
                cnt --;
            }
            dp[j] = sum / (double)cnt + 1;
        }
        if(dp[0] != 0 && scMin > dp[0]){
            scMin = dp[0];
        }
    }
    printf("%.8lf\n", scMin);

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:48:20: error: 'INT_MAX' was not declared in this scope
   48 |     double scMin = INT_MAX;
      |                    ^~~~~~~
a.cc:7:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    6 | #include<cmath>
  +++ |+#include <climits>
    7 |
Language: C++

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

using namespace std;
using namespace __gnu_pbds; // gp_hash_table<int, int> table;

template <typename T> void smin(T &a, const T &b) { a = (a < b ? a : b); }
template <typename T> void smax(T &a, const T &b) { a = (a > b ? a : b); }

typedef long long ll;
typedef long double ld;
typedef unsigned int uint;
typedef unsigned long long ull;

const int N = 650;

vector <int> g[N];

double dp[N];
const ld EPS = 1e-7;

bool used[N];

int bad = 0;
void dfs(int u)
{
  used[u] = 1;
  for (int v : g[u])
  {
    if (!used[v])
      dfs(v);
    dp[u] += (dp[v] + 1) / g[u].size();
  }
  if (g[u].empty())
    smin(bad, u);
}

/*void dfs2(int u)
{

}
*/
signed main()
{
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n, m;
  cin >> n >> m;

  for (int i = 0; i < m; i++)
  {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    //rg[v].push_back(u);
  }

  ld ans = N * N * N;
  bad = n;
  dfs(1);
  smin(ans, dp[1]);
  for (int u = 1; u <= n; u++)
  {
    for (int e = 0; e < g[u].size(); e++)
    {
      int v = g[u][e];
      swap(g[u][e], g[u].back());
      g[u].pop_back();
      fill(used, used + N, 0);
      fill(dp, dp + N , 0);
      bad = n;
//      dfs(1);
      re_dfs()
      if (bad == n)
        smin(ans, dp[1]);

      g[u].push_back(v);
      swap(g[u][e], g[u].back());
    }
  }
  cout << fixed << setprecision(10) << ans;

/*  vector <ld> prob(n + 1);
  prob[1] = 1;
  for (int i = 2; i <= n; i++)
  {
    for (int v : g[i])
      prob[i] += prob[v] / g[v].size();
  }

  for (int i = 1; i <= n; i++)
  {
    if (g[i].size() == 1)
      continue;

    ld cur = dp[i];
    for (int v : g[i])
    {
      cur -= (dp[v] + 1) / g[u].size();
      cur += (dp[v] + 1) / (g[u].size() - 1);
    }

    for (int v : g[i]);

  }
  cout << ans;
*/

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:63:7: error: no matching function for call to 'smin(ld&, double&)'
   63 |   smin(ans, dp[1]);
      |   ~~~~^~~~~~~~~~~~
a.cc:10:28: note: candidate: 'template<class T> void smin(T&, const T&)'
   10 | template <typename T> void smin(T &a, const T &b) { a = (a < b ? a : b); }
      |                            ^~~~
a.cc:10:28: note:   template argument deduction/substitution failed:
a.cc:63:7: note:   deduced conflicting types for parameter 'const T' ('long double' and 'double')
   63 |   smin(ans, dp[1]);
      |   ~~~~^~~~~~~~~~~~
a.cc:75:7: error: 're_dfs' was not declared in this scope
   75 |       re_dfs()
      |       ^~~~~~
Language: C++

import sys
input = sys.stdin.readline
sys.setrecursionlimit(pow(10, 6))


def main():
    n, m = map(int, input().split())
    edges = [[] for _ in range(n)]
    for _ in range(m):
        s, t = map(int, input().split())
        edges[s-1].append(t-1)
    
    ans = n + 1
    for i in range(n - 1):
        # 頂点 i からの辺を消す
        dp = [0 for _ in range(n)]

        for j in range(n - 2, -1, -1):
            totale, maxe = 0, 0
            for e in edges[j]:
                totale += dp[e]
                maxe = max(maxe, dp[e])
        
            if i == j and len(edges[j]) > 1:
                dp[j] = (totale - maxe) / (len(edges[j]) - 1) + 1
            else:
                dp[j] = totale / len(edges[j]) + 1
        
        ans = min(ans, dp[0])
    
    print("%.10f" % ans)


if __name__ == '__main__':
    main()


Compiler output:
a.cc:15:11: error: invalid preprocessing directive #\U00009802\U000070b9
   15 |         # 頂点 i からの辺を消す
      |           ^~~~
a.cc:34:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   34 | if __name__ == '__main__':
      |                ^~~~~~~~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import sys
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include <stdio.h>
#include <vector>

using namespace std;

vector<int> e[611];
double dis1[611],dis0[611];
int main()
{
    int n,m;scanf("%d%d",&n,&m);
    for (int i=0;i<m;++i)
    {
        int t1,t2;scanf("%d%d",&t1,&t2);
        e[t1].push_back(t2);
    }
    for (int i=0;i<m;++i) dis0[i]=dis1[i]=0;

    for (int i=n-1;i>0;--i){
        for (int j=0;j<e[i].size();++j){
            dis0[i]+=dis0[e[i][j]];
        }
        if (!e[i].size()) continue;
        dis0[i]/=(1.0*e[i].size());dis0[i]+=1.0;
        dis1[i]=dis0[i];
    }
    double ans=dis0[1];
    for (int i=1;i<n;++i){
        double tmp_max=0;
        if (e[i].size()==1) continue;
        dis1[i]=0;
        for (int j=0;j<e[i].size();++j){
            if (dis1[e[i][j]]>tmp_max)
                tmp_max=dis1[e[i][j]];
            dis1[i]+=dis1[e[i][j]];
        }
        dis1[i]-=tmp_max;
        dis1[i]/=(1.0*e[i].size()-1.0);
        dis1[i]+=1.0;
        for (int j=i-1;j>0;--j){
            dis1[j]=0;
            for (int k=0;k<e[j].size();++k)
                dis1[j]+=dis1[e[j][k]];
            if (!e[k].size()) continue;
            dis1[j]/=(1.0*e[j].size());
            dis1[j]+=1.0;
        }
        if (dis1[1]<ans) ans=dis1[1];
    }
    printf("%.8lf",ans);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:43:20: error: 'k' was not declared in this scope
   43 |             if (!e[k].size()) continue;
      |                    ^
Language: Java

import java.util.ArrayList;
import java.util.Scanner;

public class ABC144f {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        ArrayList<ArrayList<Integer>> passages = new ArrayList<ArrayList<Integer>>();
        for (int i = 0; i < N - 1; i++) {
            passages.add(new ArrayList<Integer>());
        }
        for (int i = 0; i < M; i++) {
            int s = sc.nextInt();
            int t = sc.nextInt();
            passages.get(s-1).add(t-1);
        }

        // no blocking
        double[] E = new double[N];
        for (int i = N - 2; i >= 0; i--) {
            double sum = 0;
            for (int dest: passages.get(i)) {
                sum += E[dest];
            }
            E[i] = sum / passages.get(i).size() + 1;
        }

        double minE = E[0];

        // with blocking
        for (int i = 0; i < N - 1; i++) {
            int len = passages.get(i).size();
            if (len == 1) {
                continue;
            }
            double maxE = 0;
            for (int dest: passages.get(i)) {
                maxE = Math.max(maxE, E[dest]);
            }
            E[i] = ((E[i] - 1) * len - maxE) / (len - 1) + 1;
            if (i > 0) {
                for (int j = i - 1; j >= 0; j--) {
                    double sum = 0;
                    for (int dest: passages.get(j)) {
                        sum += E[dest];
                    }
                    E[j] = sum / passages.get(j).size() + 1;
                }
            }
            minE = Math.min(minE, E[0]);
        }

        System.out.println(minE);
    }
}


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

#include <bits/stdc++.h>
#include <vector>
#include <iostream>
#define rep(i, j) for (int (i)=0;(i)<(j);(i)++)
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
using namespace std;
typedef long long ll;

int N,M;
vector<vector<int>> dir(1000);
void input(){
    cin >> N >> M;
    rep(i, N){
        int a, b;
        cin >> a >> b;
        --a;--b;
        dir[a].push_back(b);
    }
}

    void solve(){
    //期待値をdpで求める
    vector<double> dp(N);
    for(int i = N-2;i>=0;i--){
        double por = 0;
        for (int v: dir[i]){
            por += dp[v];
        }
        por /= dir[i].size();
        por += 1;
        dp[i] = por;
    }
    double ans = dp[0];
    //どこに青木をいれる？
    for (int i=0;i<N-1;i++){
        if(dir[0].size() == 1)continue;
        double por2 = dir[i][0];
        for(int v: dir[i]){
            if(dp[por2] < dp[v])por2 = v;
        }

        double por = [&]{
            
            vector<double> dp1(N);
            double a = 10000;
            
            for(int j = N-2;j>=0;j--){
                double por = 0;
                for (int v: dir[j]){
                    if(v == por2 && i == j )continue;
                    por += dp[v];
                }   
                int num = dir[j].size();
                if (j == por2)num--;
                por /= num;
                por += 1;
                dp[j] = por;
        }
        return dp[0];
        
        }();
        ans = min(ans, por);
    }
    printf("%.10f\n", ans);
}*/

int main () {
    input();
    solve();
    return 0;
}

Compiler output:
a.cc:66:3: error: expected unqualified-id before '/' token
   66 | }*/
      |   ^
Language: C++

#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<deque>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
using namespace std;

typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
typedef long double ld;
const int inf=1e9+7;
const ll INF=1LL<<60 ;
const ll mod=1e9+7 ;
#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<int, int> P;
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
#define debug(x)  cout << #x << " = " << (x) << endl;
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; }
//#define int long long

void solve() {
	int n, m; cin >> n >> m;
    vector<vector<int>> G(n, vector<int>);
    rep(i, m) {
        int s, t; cin >> s >> t; --s; --t;
        G[s].push_back(t);
    }
    vector<double> dp(n, 0);
    //DAGなのでdp
    for(int i = n - 2; i >= 0; --i) {
        int cnt = (int)G[i].size();
        for(auto e: G[i]) {
            dp[i] += (dp[e] + 1.0) / (double)cnt;
        }
    }
    double ans = dp[0];
    //探索するもののを減らすべし
    rep(i, n - 2) {
        vector<double> dp2(n, 0);
        for(int j = n - 2; j >= 0; --j) {
            int cnt = (int)G[j].size();
            for(auto e: G[i]) {
                dp2[i] += (dp2[e] + 1.0) / (double)cnt;
            }
            if(j == i) {
                --cnt;
                priority_queue<double, vector<double>, greater<double>> pque;
                for(auto e: G[j]) {
                    pque.push(dp[e]);
                }
                rep(k, cnt) {
                    int next = pque.top(); pque.pop();
                    dp2[i] += (dp2[next] + 1.0) / (double)cnt;
                }
            }
        }
        chmin(ans, dp2[0]);
    }
    cout << ans << endl;
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout << fixed << setprecision(10);
	//init();
	solve();
	//cout << "finish" << endl;
    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:54:41: error: expected primary-expression before ')' token
   54 |     vector<vector<int>> G(n, vector<int>);
      |                                         ^