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

#include <iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
ll a[200001],b[200001];
int main()
{
	ll n,k;
	cin>>n>>k;
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
	}
	for(int i=0;i<n;i++)
	{
		cin>>b[i];
	}
	sort(a,a+n,less<int>());
	sort(b,b+n,greater<int>());
	ll y=-1;
	for(int i=0;i<n;i++)
	{
		y=max(a[i]*b[i],y);
	}
	ll x=0;
	ll time=0;
	while(x<y)
	{
		ll m=x+(y-x)/2;
		ll flag=1;
		ll tmpk=0;
		time++;
		for(int i=0;i<n;i++)
		{
			ll res=m/b[i];
			if(res>a[i])continue;
			tmpk+=a[i]-res;
			if(tmpk>k){
			flag=0;
			break;}
		}
		if(flag)y=m;
		else x=m+1;
	}
	cout<<x
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:16: error: expected ';' before 'return'
   45 |         cout<<x
      |                ^
      |                ;
   46 |         return 0;
      |         ~~~~~~
Language: C++

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

int main()
{
    int n;
    ll k;
    cin >> n >> k;
    vector<int> a(n);
    vector<int> f(n);
    rep(i, n) cin >> a[i];
    rep(i, n) cin >> f[i];
    sort(a.begin(), a.end());
    sort(f.rbegin(), f.rend());
    ll l = -1, r = 1e12;
    while (l + 1 < r)
    {
        ll c = (1 + r) / 2;
        bool ok = [&] {
            ll s = 0;
            rep(1, n)
            {
                s += max(0ll, a[i] - c / f[i]);
            }
            return s <= k;
        }() if (ok) r = c;
        else l = c;
    }
    cout << r << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:24: error: 'nt' was not declared in this scope; did you mean 'n'?
    2 | #define rep(i, n) for (nt i = 0; i < (n); ++i)
      |                        ^~
a.cc:13:5: note: in expansion of macro 'rep'
   13 |     rep(i, n) cin >> a[i];
      |     ^~~
a.cc:13:9: error: 'i' was not declared in this scope
   13 |     rep(i, n) cin >> a[i];
      |         ^
a.cc:2:34: note: in definition of macro 'rep'
    2 | #define rep(i, n) for (nt i = 0; i < (n); ++i)
      |                                  ^
a.cc:2:24: error: 'nt' was not declared in this scope; did you mean 'n'?
    2 | #define rep(i, n) for (nt i = 0; i < (n); ++i)
      |                        ^~
a.cc:14:5: note: in expansion of macro 'rep'
   14 |     rep(i, n) cin >> f[i];
      |     ^~~
a.cc:14:9: error: 'i' was not declared in this scope
   14 |     rep(i, n) cin >> f[i];
      |         ^
a.cc:2:34: note: in definition of macro 'rep'
    2 | #define rep(i, n) for (nt i = 0; i < (n); ++i)
      |                                  ^
a.cc: In lambda function:
a.cc:2:24: error: 'nt' was not declared in this scope; did you mean 'n'?
    2 | #define rep(i, n) for (nt i = 0; i < (n); ++i)
      |                        ^~
a.cc:23:13: note: in expansion of macro 'rep'
   23 |             rep(1, n)
      |             ^~~
a.cc:23:17: error: lvalue required as increment operand
   23 |             rep(1, n)
      |                 ^
a.cc:2:45: note: in definition of macro 'rep'
    2 | #define rep(i, n) for (nt i = 0; i < (n); ++i)
      |                                             ^
a.cc:25:33: error: 'i' was not declared in this scope
   25 |                 s += max(0ll, a[i] - c / f[i]);
      |                                 ^
a.cc: In function 'int main()':
a.cc:28:13: error: expected ',' or ';' before 'if'
   28 |         }() if (ok) r = c;
      |             ^~
a.cc:29:9: error: 'else' without a previous 'if'
   29 |         else l = c;
      |         ^~~~
Language: C++

#include <bits/stdc++.h>

#define ll long long

using namespace std;

const int N = 2e5 + 123;

ll n, k;

ll a[N], b[N], r = 1e18, l = 0, pos, ans;

bool check (int x) {
    ll sum = 0;
    for (int i = 1;i <= n;i ++) {
        sum += max (0, a[i] - x / b[i]);
    }
    return sum <= k;
}

int main () {
    cin >> n >> k;
    for (int i = 1;i <= n;i ++) cin >> a[i];
    for (int i = 1;i <= n;i ++) cin >> b[i];
    sort (a + 1, a + n + 1);
    sort (b + 1, b + n + 1);
    reverse (b + 1, b + n + 1);
    while (l <= r) {
        ll mid = (l + r) >> 1;
        if (check (mid)) {
            pos = mid;
            r = mid - 1;
        }else {
            l = mid + 1;
        }
    }
    cout << pos;
}


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

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
bool cmp(int a,int b)
{
	return a>b;
}
int main()
{
	ll n,k;cin>>n>>k;
	int a[200005],f[200005];
	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,cmp);
	ll y=-1;
	for(int i=0;i<n;i++){
		y=max(a[i]*f[i],y);
	}
	ll x=0;
	int cnt=0;
	while(x<y){
		int m=x+(y-x)/2;
		int flag=1;
		ll tmpk=0;
		cnt++;
		for(int i=0;i<n;i++){
			int r=m/f[i];
			if(r>a[i]) continue;
			tmpk+=a[i]-r;
			if(tmpk>k){
			flag=0;
			break;}
		}
		if(flag)y=m;
		else x=m+1;
	}
	cout<<x<<endl;
}

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

import numpy as np
N, K = map(int, input().split())
As = np.sort(list(map(int, input().split())))
Fs = np.sort(list(map(int, input().split())))[::-1]
l  = As*Fs
left = 0
right = max(l)
while right-left>1:
    mid = left + (right - left)/2
    if np.maximum(As-mid//Fs , 0).sum()<=K:
        right = mid
    else:
        left = mid
print(int(right))

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import numpy as np
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef double db;
typedef long long ll;
typedef string str;
typedef vector<int> vi;
typedef set<int> si;
typedef pair<int,int> pii;
#define rep(i,a,b) for(int i=(a); i<(b); ++i)
#define per(i,a,b) for(int i=(b)-1; i>=(a); --i)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define F first
#define S second
const int INF = 987654321;
const int MOD = (int)1e9+7;
const long double PI = (acos(-1));
const long double EPS = 0.0000000001;
int dy[4] = {-1, 0, 1, 1};
int dx[4] = {0, 1, 0, 1};

ll n,k;
vl A;
vl F;

bool can(ll t) {
	vl B(n);
	rep(i,0,n) {
		B[i] = t/F[n-1-i];
	}
	ll nk = 0;
	rep(i,0,n) {
		nk += max(A[i] - B[i], 0);
	}
	return nk <= k;
}

ll solve() {
	ll t = 0;
	rep(i,0,n) {
		t = max(t, A[i]*F[n-1-i]);
	}

	ll left = 0;
	ll right = t;
	ll mid;
	while(left < right) {
		mid = (left+right)/2;
		if(can(mid)) {
			right = mid;
		} else {
			left = mid+1;
		}
	}
	return left;
}

int main(void) {
	//freopen("in.txt", "r", stdin);
	cin >> n >> k;
	A.resize(n);
	F.resize(n);
	rep(i,0,n) {
		cin >> A[i];
	}
	rep(i,0,n) {
		cin >> F[i];
	}

	sort(all(A));
	sort(all(F));
	printf("%lld\n", solve());
	return 0;
}

Compiler output:
a.cc:25:1: error: 'vl' does not name a type; did you mean 'vi'?
   25 | vl A;
      | ^~
      | vi
a.cc:26:1: error: 'vl' does not name a type; did you mean 'vi'?
   26 | vl F;
      | ^~
      | vi
a.cc: In function 'bool can(ll)':
a.cc:29:9: error: 'vl' was not declared in this scope; did you mean 'vi'?
   29 |         vl B(n);
      |         ^~
      |         vi
a.cc:31:17: error: 'B' was not declared in this scope
   31 |                 B[i] = t/F[n-1-i];
      |                 ^
a.cc:15:11: error: 'first' was not declared in this scope
   15 | #define F first
      |           ^~~~~
a.cc:31:26: note: in expansion of macro 'F'
   31 |                 B[i] = t/F[n-1-i];
      |                          ^
a.cc:35:27: error: 'A' was not declared in this scope
   35 |                 nk += max(A[i] - B[i], 0);
      |                           ^
a.cc:35:34: error: 'B' was not declared in this scope
   35 |                 nk += max(A[i] - B[i], 0);
      |                                  ^
a.cc: In function 'll solve()':
a.cc:43:28: error: 'A' was not declared in this scope
   43 |                 t = max(t, A[i]*F[n-1-i]);
      |                            ^
a.cc:15:11: error: 'first' was not declared in this scope
   15 | #define F first
      |           ^~~~~
a.cc:43:33: note: in expansion of macro 'F'
   43 |                 t = max(t, A[i]*F[n-1-i]);
      |                                 ^
a.cc: In function 'int main()':
a.cc:63:9: error: 'A' was not declared in this scope
   63 |         A.resize(n);
      |         ^
a.cc:15:11: error: 'first' was not declared in this scope
   15 | #define F first
      |           ^~~~~
a.cc:64:9: note: in expansion of macro 'F'
   64 |         F.resize(n);
      |         ^
Language: C++

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

using namespace std;

int main(void) {
	int64_t N, K;
	cin >> N >> K;

	vector<int64_t> A(N);
	vector<int64_t> F(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<>());


	int64_t ng = -1;
	int64_t ok = 1e12;
	int64_t mid;
	while (ok - ng > 1) {
		mid = (ok + ng) / 2;
		int64_t cnt = 0;
		for (int i = 0; i < N; i++) {
			if (A[i] * F[i] > mid) {
				cnt += A[i] - ceil(mid / F[i]);
			}
		}
		if (cnt <= K) ok = mid;
		else ng = mid;
	}

	cout << ok << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:47: error: 'ceil' was not declared in this scope
   28 |                                 cnt += A[i] - ceil(mid / F[i]);
      |                                               ^~~~
Language: C++

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

int main(){
  int n;
  ll k;
  cin >> n >> k;
  vector<int> a(n);
  vector<int> f(n);
  rep(i,n) cin >> a[i];
  rep(i,n) cin >> f[i];
  sort(a.begin(),a.end());
  sort(f.rbegin(),f.rend());
  ll l = -1, r = 1e12;
  while(l+1<r){
    ll mid = (l+r)/2;
    ll s = 0;
    bool ok = [&]{
      rep(i,n){
      s += max(0,a[i]-mid/f[i]);
      }
      return s<=k;
    }();
    if(ok) r = mid; else l = mid;
  }
  cout << r << endl;
}

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

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

int main() {
    int n;
    long long k;
    cin >> n >> k;

    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.begin(), a.end());
    sort(f.rbegin(), f.rend());

    long long sum,m,t = 1e12, r = -1;
    while (r+1 < t){
        m = (t+r)/2;
        sum = 0;
        for (int i = 0; i < n; i++){
            sum += max(0ll, a[i]-m/f[i]);
        }
        if (sum <= k){
            t = m;
        }else{r = m;}
    }
    cout << r+1;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:12: error: request for member 'begin' in 'a', which is of non-class type 'int [n]'
   18 |     sort(a.begin(), a.end());
      |            ^~~~~
a.cc:18:23: error: request for member 'end' in 'a', which is of non-class type 'int [n]'
   18 |     sort(a.begin(), a.end());
      |                       ^~~
a.cc:19:12: error: request for member 'rbegin' in 'f', which is of non-class type 'int [n]'
   19 |     sort(f.rbegin(), f.rend());
      |            ^~~~~~
a.cc:19:24: error: request for member 'rend' in 'f', which is of non-class type 'int [n]'
   19 |     sort(f.rbegin(), f.rend());
      |                        ^~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i <(n) ; ++i)
#define PI 3.14159265
using namespace std;
using ll = long long;
void self_max(int &a,int b){
	a = max(a,b);
}
void self_min(ll &a,ll b){
	a = min(a,b);
}

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

	ll l = -1, r = 1e12;
	while(l+1 < r){
		ll c = (l+r)/2;
		bool ok = [&]{
			rep(i,n){
				s += max(0ll,a[i] - c/f[i]);
			}
			return s <= k;
		}();
		if(ok) r = c; else l=c;
	}

	cout << r << endl;
	
	return 0;
}




Compiler output:
a.cc: In lambda function:
a.cc:27:33: error: 's' was not declared in this scope
   27 |                                 s += max(0ll,a[i] - c/f[i]);
      |                                 ^
a.cc:29:32: error: 's' was not declared in this scope
   29 |                         return s <= k;
      |                                ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define be begin()
#define en end()
#define le length()
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (__typeof(n) i = 0; i < n; i++)
#define repo(i, n) for (__typeof(n) i = 1; i <= n; i++)
#define fastIO                        \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL)
#define eps 1e-6
#define pi 3.141592653589793
#define c(a) cout << a << "\n";
#define ao(a)        \
    for (auto i : a) \
        cout << i << " ";
typedef vector<int> vii;
typedef vector<ll> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int MOD = 1e9 + 7;
const int INF = 1e9;
int main()
{
    ll n, k;
    cin >> n >> k;
    ll a[n], b[n];
    rep(i, n) cin >> a[i];
    rep(i, n) cin >> b[i];
    sort(a, a + n, greater<ll>());
    sort(b, b + n);
    ll l = -1, r = a[0] * b[0], p = k, mid;
    while (r - l > 1)
    {
        p = k;
        mid = (l + r) >> 1;
        rep(i, n)
        {
            p -= max(0LL, a[i] - (mid / b[i]));
            if (p < 0)
                break;
        }
        if (p >= 0)
            r = mid;
        else
            l = mid;
    }
   c(hi)
}

Compiler output:
a.cc: In function 'int main()':
a.cc:56:6: error: 'hi' was not declared in this scope; did you mean 'fi'?
   56 |    c(hi)
      |      ^~
a.cc:21:22: note: in definition of macro 'c'
   21 | #define c(a) cout << a << "\n";
      |                      ^
Language: C++

#include <algorithm>
#include <bits/stdc++.h>
#include <bitset>
#include <cassert>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <memory>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <vector>
using namespace std;
#define REP(i, n) for (int64_t i = 0; i < (int64_t)n; i++)
#define REP_FOR(i, a, b) for (int64_t i = (int64_t)a; i < (int64_t)b; i++)
#define REP_REV(i, a, b) for (int64_t i = (int64_t)a; i > (int64_t)b; i--)
#define FORALL(v) (v).begin(), (v).end()
#define mp(a, b) make_pair(a, b)
#define eb(x) emplace_back(x)
#define F first
#define S second
typedef long long ll;
typedef long double ld;
typedef pair<int64_t, int64_t> pii;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pdd;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<int64_t> vii;
typedef vector<vii> vvii;
const ll mod = 1e9 + 7;
const int64_t infi = 1147483600;
const ll infl = 4e18 + 5;
const char EOL = '\n';
//cout << fixed << setprecision(17) << res << endl;
const ll MOD = 998244353;

bool operator<(const tuple<int64_t, int64_t, int64_t> &lhs, const tuple<int64_t, int64_t, int64_t> &rhs)
{
    return get<0>(lhs) > get<0>(rhs);
}

int main() {
    int64_t n, k;
    cin >> n >> k;
    vector<int64_t> a(n);
    vector<int64_t> f(n);
    int64_t asum = 0 , fsum = 0;
    for (int64_t i = 0; i < n; ++i) {
        cin >> a[i];
        asum += a[i];
    }
    for (int64_t i = 0; i < n; ++i) {
        cin >> f[i];
    }
    if (k >= asum) {
        cout << 0 << endl;
        return;
    }

    sort(a.begin(), a.end(), greater<int64_t>());
    sort(f.begin(), f.end());

    auto left = -1ll;
    auto right = a[0] * f[n-1];

    int64_t used;
    int64_t mid = 0;
    while (left + 1 < right) {
        mid = (left + right) / 2;
        // cerr << "left is " << left << ", right is " << right << ", mid is " << mid << endl;
        // check all cost (-k value) <= mid
        used = 0;
        for (int64_t i = 0; i < n; ++i) {
            auto cost = a[i] * f[i];
            if (mid < cost) {
                used += a[i] - mid/f[i];
            }
        }
        if (used <= k) {
            right = mid;
        } else {
            left = mid;
        }
    }
    cout << right << endl;
}


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

//ギブアップ 2019/11/8
//key 二分探索
#include<iostream>
#include<algorithm>
#include <vector>
using namespace std;
typedef long long ll;

int main(){
int n
ll k;
std::cin >> n>>k;
std::vector<int> a(n);
std::vector<int> f(n);

for (int i = 0; i < n; i++)std::cin >> a[i];
for (int i = 0; i < n; i++)std::cin >> f[i];

sort(a.begin(),a.end());
sort(f.begin(),f.end(),std::greater<int>());

ll l=-1,r=1e12;
ll  c;
ll  s;
while (1+l<r) {
      c=(l+r)/2;
      s=0;
      for (int i = 0; i < n; ++i) {
        s+=max(a[i]-c/f[i],(ll)0);
      }
      if(s<=k)r=c;else l=c;
}

std::cout << r << '\n';

return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:1: error: expected initializer before 'll'
   11 | ll k;
      | ^~
a.cc:12:13: error: 'n' was not declared in this scope
   12 | std::cin >> n>>k;
      |             ^
a.cc:12:16: error: 'k' was not declared in this scope
   12 | std::cin >> n>>k;
      |                ^
Language: C++

//ギブアップ 2019/11/8
//key 二分探索
#include<iostream>
#include<bits/stdc++.h>
#include<algorithm>
#include <vector>
using namespace std;
int main(){
int n,k;
std::cin >> n>>k;
std::vector<int> a(n);
std::vector<int> f(n);

for (int i = 0; i < n; i++){
    std::cin >> a[i];
}
for (int i = 0; i < n; i++){
  std::cin >> f[i];
}

sort(a.begin(),a.end());
sort(f.begin(),f.end(),std::greater<int>());

long l=-1,r=1e12;
while (1+r<r) {
  long c=(l+r)/2;
  bool ok =[&]{
      long s = 0;
      for (i = 0; i < n; i++) {
        s+=mas(011,a[i]-c/f[i]);
      }
      return s<=r;
  }()
  if(ok) r=c;else l=c;
}
std::cout << r << '\n';

return 0;
}


Compiler output:
a.cc: In lambda function:
a.cc:29:12: error: 'i' was not declared in this scope
   29 |       for (i = 0; i < n; i++) {
      |            ^
a.cc:30:12: error: 'mas' was not declared in this scope
   30 |         s+=mas(011,a[i]-c/f[i]);
      |            ^~~
a.cc: In function 'int main()':
a.cc:34:3: error: expected ',' or ';' before 'if'
   34 |   if(ok) r=c;else l=c;
      |   ^~
a.cc:34:14: error: 'else' without a previous 'if'
   34 |   if(ok) r=c;else l=c;
      |              ^~~~
Language: C++

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

int main(){
  int n;
  ll k;
  cin >> n >> k;
  vector<int> a(n);
  vector<int> f(n);
  rep(i,n) cin >> a[i];
  rep(i,n) cin >> f[i];
  sotr(a.begin(),a.end());
  sort(b.rbegin(),b.rend());
  ll l = -1, r = 1e12;
  while(l+1<r){
    ll mid = (l+r)/2;
    ll s = 0;
    bool ok = [&]{
    rep(i,n){
      s += max(0ll,a[i]-mid/f[i]);
    }
      return s<=k;
    }();
    if(ok) r = mid; else l = mid;
  }
  
  cout << r << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:3: error: 'sotr' was not declared in this scope
   14 |   sotr(a.begin(),a.end());
      |   ^~~~
a.cc:15:8: error: 'b' was not declared in this scope
   15 |   sort(b.rbegin(),b.rend());
      |        ^
Language: C++

#include <iostream>
#include <algorithm>
 
long long main(){
     long long n;
     long long k;
     long long a[200000];
     long long f[200000];
    std::cin>>n;
    std::cin>>k;
    for( long long i=0;i<n;++i){
        std::cin>>a[i];
    }
    for( long long i=0;i<n;++i){
        std::cin>>f[i];
    }
    std::sort(a,a+n);
    std::sort(f,f+n,std::greater< long long>());
    for( long long i=0;i<k;++i){
         long long max=0;
         long long maxJ;
        for( long long j=0;j<n;++j){
             long long p=a[j]*f[j];
            if(max<p){
                maxJ=j;
                max=p;
            }
        }
        if(max==0){
            break;
        }else{
            --a[maxJ];
        }
    }
     long long ans=0;
    for( long long i=0;i<n;++i){
         long long p=a[i]*f[i];
        if(ans<p){
            ans=p;
        }
    }
    std::cout<<ans;
    return 0;
}

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

#include"bits/stdc++.h"
#include"math.h"
using namespace std;

template<class t,class u> void chmax(t&a,u b){if(a<b)a=b;}
template<class t,class u> void chmin(t&a,u b){if(b<a)a=b;}
 

using ll = long long int;
using ld = long double;
using pii = pair<int,int>;

#define REP(i,m,n) for(ll i = m; i < (ll)(n);++i)
#define rep(i,n) REP(i,0,n)
#define all(v) v.begin(),v.end()
#define pb push_back
#define eb emplace_back

template<class t> using vc=vector<t>;
template<class t> using vvc=vc<vc<t>>;
 
using vi=vc<int>;

const ll mod=1e9+7;

int main(){
  cin.tie(0);
	ios::sync_with_stdio(0);
	cout<<fixed<<setprecision(20);
	
  int n,k;cin >> n >> k;
  vector<int> a(n),f(n);
  rep(i,n) cin >> a[i] >> f[i];
  

Compiler output:
a.cc: In function 'int main()':
a.cc:33:32: error: expected '}' at end of input
   33 |   rep(i,n) cin >> a[i] >> f[i];
      |                                ^
a.cc:26:11: note: to match this '{'
   26 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>//glutonyの回答
#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;
ll MAX_N = 2e5
int N; ll K;
vector<ll> A(MAX_N) vector<ll> F(MAX_N);


void input(){
    cin >> N >> K;
    for(int i = 0; i<N;i++)cin >> A[i];
    for(int i=0;i<N;i++)cin >> F[i];
    return ;
}

void solve(){
    sort(A.begin(), A.end());
    sort(F.begin(), F.end());
    reverse(F.begin(), F.end());
    ll l = -1, r = 1e12;
    while(l+1<r){
        ll c = (l+r)/2;
        bool ok = [&]{
            ll t = 0;
            rep(i, N) {
                t += max(0ll, A[i] - c/F[i]);
            }
            return t <= K;
        }();
        if(ok) r = c;else l = c;
    }
    cout << r << endl;
    


}

int main() {

    input();
    solve();
    return 0;
}

Compiler output:
a.cc:10:1: error: expected ',' or ';' before 'int'
   10 | int N; ll K;
      | ^~~
a.cc:11:21: error: expected ',' or ';' before 'vector'
   11 | vector<ll> A(MAX_N) vector<ll> F(MAX_N);
      |                     ^~~~~~
a.cc: In function 'void input()':
a.cc:15:12: error: 'N' was not declared in this scope
   15 |     cin >> N >> K;
      |            ^
a.cc:17:32: error: 'F' was not declared in this scope
   17 |     for(int i=0;i<N;i++)cin >> F[i];
      |                                ^
a.cc: In function 'void solve()':
a.cc:23:10: error: 'F' was not declared in this scope
   23 |     sort(F.begin(), F.end());
      |          ^
a.cc: In lambda function:
a.cc:30:20: error: 'N' was not declared in this scope
   30 |             rep(i, N) {
      |                    ^
a.cc:4:39: note: in definition of macro 'rep'
    4 | #define rep(i, j) for (int (i)=0;(i)<(j);(i)++)
      |                                       ^
Language: C++

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

ll MAX_N = 2*10e5;
int N; ll k;
vector<int> A(N); vector<int> F(N);
vector<int> C(N);

void input(){
    cin >> N >> K;
    rep(i, N)cin >> A[i];
    rep(i, N) cin >> F[i];
}

void solve(){
    sort(A.begin(), A.end());
    sort(F.begin(), F.end());
    reverse(F.begin(), F.end());
    ll l = -1, r = 1e12;
    while(l+1<r){
        ll c = (l+r)/2;
        bool ok = [&]{
            ll t = 0;
            rep(i, N) {
                t += max(0ll, A[i] - c/F[i]);
            }
            return t <= K;
        }();
        if(ok) r = c;else l = c;
    }
    cout << r << endl;
    


}

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

Compiler output:
a.cc: In function 'void input()':
a.cc:16:17: error: 'K' was not declared in this scope
   16 |     cin >> N >> K;
      |                 ^
a.cc: In lambda function:
a.cc:33:25: error: 'K' was not declared in this scope
   33 |             return t <= K;
      |                         ^
Language: C++

#include <bits/stdc++.h>
#include <vector>
#include <iostream>
#define rep(ii, jj) for (int (ii)=0;(ii)<(jj);(ii)++)
#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; ll k;
vector<int> A(N); vector<int> F(N);


void input(){
    cin >> N >> K;
    rep(i, N)cin >> A[i];
    rep(i, N) cin >> F[i];
}

void solve(){
    sort(A.begin(), A.end());
    sort(F.rbegin(), F.rend());
    ll l = -1, r = 1e12;
    while(l+1<r){
        ll c = (l+r)/2;
        bool ok = [&]{
            ll t = 0;
            rep(i, N) {
                t += max(0ll, A[i] - c/F[i]);
            }
            return t <= K;
        }();
        if(ok) r = c;else l = c;
    }
    cout << r << endl;
    


}

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

Compiler output:
a.cc: In function 'void input()':
a.cc:15:17: error: 'K' was not declared in this scope
   15 |     cin >> N >> K;
      |                 ^
a.cc: In lambda function:
a.cc:31:25: error: 'K' was not declared in this scope
   31 |             return t <= K;
      |                         ^
Language: C++

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

ll MAX_N = 2*10e5;
ll N, K;
vector<ll> A(N); vector<ll> F(N);
vector<ll> C(N);

void input(){
    cin >> N >> K;
    rep(i, N)cin >> A[i];
    rep(i, N) cin >> F[i];
}

void solve(){
    sort(A.begin(), A.end());
    sort(F.rbegin(), F.rend());
    ll l = -1, r = 1e12;
    while(l+1<r){
        ll c = (l+r)/2;
        bool ok = [&]{
            ll t = 0;
            rep(i, N) {
                t += max(ll0, A[i] - c/F[i]);
            }
            return t <= K;
        }();
        if(ok) r = c;else l = c;
    }
    cout << r << endl;
    


}

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

Compiler output:
a.cc: In lambda function:
a.cc:30:26: error: 'll0' was not declared in this scope; did you mean 'll'?
   30 |                 t += max(ll0, A[i] - c/F[i]);
      |                          ^~~
      |                          ll
Language: C++

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

ll MAX_N = 2*10e5;
ll N, K;
vector<ll> A(N); vector<ll> F(N);
vector<ll> C(N);

void input(){
    cin >> N >> K;
    rep(i, N)cin >> A[i];
    rep(i, N) cin >> F[i];
}

void solve(){
    sort(A.begin(), A.end());
    sort(F.rbegin(), F.rend());
    ll l = -1, r = 1e12;
    while(l+1<r){
        ll c = (l+r)/2;
        bool ok = [&]{
            ll t = 0;
            rep(i, N) {
                t += max(0, A[i] - c/F[i]);
            }
            return t <= K;
        }();
        if(ok) r = c;else l = c;
    }
    cout << r << endl;
    


}

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

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

#include <iostream>
#include <algorithm>

int main(){
    unsigned int n;
    unsigned long long k;
    unsigned int a[200000];
    unsigned int f[200000
    std::cin>>n;
    std::cin>>k;
    for(unsigned int i=0;i<n;++i){
        std::cin>>a[i];
    }
    for(unsigned int i=0;i<n;++i){
        std::cin>>f[i];
    }
    std::sort(a,a+n);
    std::sort(f,f+n,std::greater<int>());
    for(unsigned long long i=0;i<k;++i){
        unsigned int max=0;
        unsigned int maxJ;
        for(unsigned int j=0;j<n;++j){
            unsigned int p=a[j]*f[j];
            if(max<p){
                maxJ=j;
                max=p;
            }
        }
        if(max==0){
            break;
        }else{
            --a[maxJ];
        }
    }
    unsigned int ans=0;
    for(unsigned int i=0;i<n;++i){
        unsigned int p=a[i]*f[i];
        if(ans<p){
            ans=p;
        }
    }
    std::cout<<ans;
    return 0;
}





Compiler output:
a.cc: In function 'int main()':
a.cc:8:26: error: expected ']' before 'std'
    8 |     unsigned int f[200000
      |                          ^
      |                          ]
    9 |     std::cin>>n;
      |     ~~~                   
a.cc:15:19: error: 'f' was not declared in this scope
   15 |         std::cin>>f[i];
      |                   ^
a.cc:18:15: error: 'f' was not declared in this scope
   18 |     std::sort(f,f+n,std::greater<int>());
      |               ^
Language: C++

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

#define rep(i,n) for (int i = 0; i < (n); ++i)

using namespace std;

typedef long long ll;

ll n, k;

bool is_ok(ll x, vector<ll> a, vector<ll> f) {
  ll p = k;
  for (int i = 0; i < n; i++) {
    if ( x/f[i] < a[i] ) {
      p -= (a[i]-x/f[i]);
    }
  }
  return p >= 0;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << setprecision(20) << fixed;

  cin >> n >> k;
  vector<ll> a(n), f(n);

  rep(i, n) { cin >> a[i]; }
  rep(i, n) { cin >> f[i]; }

  sort( a.begin(), a.end() );
  sort( f.begin(), f.end(), greater<ll>() );

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

    if ( is_ok(mid, a, f) ) {
      ok = mid;
    } else {
      ng = mid;
    }
  }

  cout << ok << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:11: error: 'setprecision' was not declared in this scope
   26 |   cout << setprecision(20) << fixed;
      |           ^~~~~~~~~~~~
a.cc:4:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    3 | #include <vector>
  +++ |+#include <iomanip>
    4 |
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main()
{
    int N;
    long long 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];

    sort(a.begin(), a.end());
    sort(f.rbegin(), f.rend()); //降順
    long long l = -1, r = 1e12; // 左と右
    long long p;                //ピボット
    while (l + 1 < r)
    {
        p = (l + r) / 2;
        bool ok = [&] {
            long long s = 0;
            for (int i = 0; i < n; i++)
            {
                s += max(0ll, a[i] - p / f[i]);
            }
            return s <= K;
        }();
        if (ok)
            r = p;
        else
            l = p;
    }
    cout << r << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:19: error: 'n' was not declared in this scope
   10 |     vector<int> a(n);
      |                   ^
Language: C++

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

ll MAX_N = 2*10e5;
int N, ll K;
vector<int> A(N); vector<ll> F(N);


void input(){
    cin >> N >> K;
    rep(i, N)cin >> A[i];
    rep(i, N) cin >> F[i];
}

void solve(){
    sort(A.begin(), A.end());
    sort(F.rbegin(), F.rend());
    ll l = -1, r = 1e12;
    while(l+1<r){
        ll c = (l+r)/2;
        bool ok = [&]{
            ll t = 0;
            rep(i, N) {
                t += max(0ll, A[i] - c/F[i]);
            }
            return t <= K;
        }();
        if(ok) r = c;else l = c;
    }
    cout << r << endl;
    


}

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

Compiler output:
a.cc:12:11: error: expected initializer before 'K'
   12 | int N, ll K;
      |           ^
a.cc: In function 'void input()':
a.cc:17:17: error: 'K' was not declared in this scope
   17 |     cin >> N >> K;
      |                 ^
a.cc: In lambda function:
a.cc:33:25: error: 'K' was not declared in this scope
   33 |             return t <= K;
      |                         ^
Language: C++

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

ll MAX_N = 2*10e5;
ll N, K;
vector<ll> A(N); vector<ll> F(N);
vector<ll> C(N);

void input(){
    cin >> N >> K;
    rep(i, N)cin >> A[i];
    rep(i, N) cin >> F[i];
}

void solve(){
    sort(A.begin(), A.end());
    sort(F.rbegin(), F.rend();
    ll l = -1, r = 1e12;
    while(l+1<r){
        ll c = (l+r)/2;
        bool ok = [&]{
            ll t = 0;
            rep(i, N) {
                t += max(0ll, A[i] - c/F[i]);
            }
            return t <= K;
        }();
        if(ok) r = c;else l = c;
    }
    cout << r << endl;
    


}

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

Compiler output:
a.cc: In function 'void solve()':
a.cc:24:30: error: expected ')' before ';' token
   24 |     sort(F.rbegin(), F.rend();
      |         ~                    ^
      |                              )
Language: C++

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

ll MAX_N = 2*10e5;
ll N, K;
vector<ll> A(N); vector<ll> F(N);
vector<ll> C(N);

void input(){
    cin >> N >> K;
    rep(i, N)cin >> A[i];
    rep(i, N) cin >> F[i];
}

void solve(){
    sort(A.begin(), A.end());
    sort(F.rbegin(), F.rend();
    ll l = -1, r = 1e12;
    while(l+1<r){
        ll c = (l+r)/2;
        bool ok = [&](){
            ll t = 0;
            rep(i, N) {
                t += max(0ll, A[i] - c/F[i]);
            }
            return t <= k;
        }();
        if(ok) r = c;else l = c;
    }
    cout << r << endl;
    


}

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

Compiler output:
a.cc: In function 'void solve()':
a.cc:24:30: error: expected ')' before ';' token
   24 |     sort(F.rbegin(), F.rend();
      |         ~                    ^
      |                              )
a.cc: In lambda function:
a.cc:33:25: error: 'k' was not declared in this scope
   33 |             return t <= k;
      |                         ^
Language: C++

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

ll MAX_N = 2*10e5;
ll N, K;
vector<ll> A(N); vector<ll> F(N);
vector<ll> C(N);

void input(){
    cin >> N >> K;
    rep(i, N)cin >> A[i];
    rep(i, N) cin >> F[i];
}

void solve(){
    sort(A.begin(), A.end());
    sort(F.rbegin(), F.rend();
    ll l = -1, r = 1e12;
    while(l+1<r){
        ll c = (l+r)/2;
        bool ok = [&](){
            ll t = 0;
            rep(i, N) {
                t += max(0ll, A[i] - c/F[i]);
            }
            return s <= k;
        }();
        if(ok) r = c;else l = c;
    }
    cout << r << endl;
    


}

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

Compiler output:
a.cc: In function 'void solve()':
a.cc:24:30: error: expected ')' before ';' token
   24 |     sort(F.rbegin(), F.rend();
      |         ~                    ^
      |                              )
a.cc: In lambda function:
a.cc:33:20: error: 's' was not declared in this scope
   33 |             return s <= k;
      |                    ^
a.cc:33:25: error: 'k' was not declared in this scope
   33 |             return s <= k;
      |                         ^
Language: C++

#include<iostream>
#include<cmath>
#include<vector>
#include<algorithm>
#include<numeric>
using namespace std;
using uint = unsigned int;
using ull = unsigned long long;

bool judge(const ull K, const ull T, const vector<uint>& A, const vector<uint>& F) {
	
	ull sum = 0;
	for(ull i = 0; i<A.size(); i++) {
		ull d = T / F[i];
		if (A[i] > d) {
			sum += A[i] - d;
			if (sum > K) {
				return false;
			}
		}
	}
	return true;
}

int main() {
	ull N, K;
	cin >> N >> K;
	
	vector<uint> A(N);
	for (uint n=0; n<N; n++) {
		cin >> A[n];
	}
	
	if (K >= accumulate(A.begin(), A.end(), 0)) {
		cout << 0;
		return 0;
	}
	
	vector<uint> F(N);
	for (uint n=0; n<N; n++) {
		cin >> F[n];
	}
	
	sort(A.begin(), A.end());
	sort(F.begin(), F.end(), greater<uint>());
	
	ull low = 0;
	ull high = 0;
	
	for (uint n=0; n<N; n++) {
		high = max(high, ull(A[n]) * ull(F[n])));
	}
	
	while (low < high) {
		ull mid = (low + high) / 2;
 
		if (judge(K, mid, A, F)) {
			high = mid;
		} else {
			low = mid + 1;
		}
	}
	
	cout << low;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:56: error: expected ';' before ')' token
   51 |                 high = max(high, ull(A[n]) * ull(F[n])));
      |                                                        ^
      |                                                        ;
Language: C++

#include <iostream>
#include <vector>
#include <queue>
#define rep(i, n) for(int i = 0; i < (n); i++)
using namespace std;

typedef long long ll;
typedef pair<ll, int> P;

int main() {
	int n;
	ll k;
	cin >> n >> k;
	vector<int> a(n);
	vector<int> f(n);
	rep(i, n) cin >> a[i];
	rep(i, n) cin >> f[i];
	sort(a.begin(), a.end());
	sort(f.rbegin(), f.rend());
	ll l = -1, r = 1e12;
	while (l + 1 < r) {
		ll c = (l + r) / 2;
		bool ok = [&] {
			ll s = 0;
			rep(i, n) {
				s += max(0ll, a[i] - c / f[i]);
			}
			return s <= k;
		}();
		if (ok) r = c; else l = c;
	}
	cout << r << endl;
	return 0;
}


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

#include<iostream>
#include <vector>
#include <algorithm> // sort
#include <map> // pair
#include <functional>
 
#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0]))
 
using namespace std;
int main()
{
    int n,k;
    cin >> n >> k;
    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 + SIZE_OF_ARRAY(a));
    sort(f, f + SIZE_OF_ARRAY(f));
    vector<pair<int, int> > pairs(n);
    for (int i = 0; i < n; i++) {
        pairs[i] = make_pair(a[i]*f[n-1-i],a[i]);
    }
    int ans=0;
    int sumk=0;
    while(true){
        sumk=0;
        for(int i=1;i<n;i++){
            if(pairs[i].first>ans){
                sumk += (pairs[i].first-ans-1)/pairs[i].second+1;
            }
        }
        if(sumk<=k){
            break;
        }
        ans++
    }
    cout << ans;
 
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:14: error: expected ';' before '}' token
   39 |         ans++
      |              ^
      |              ;
   40 |     }
      |     ~