제출 #1174786

#제출 시각아이디문제언어결과실행 시간메모리
1174786TsaganaSelf Study (JOI22_ho_t2)C++20
0 / 100
0 ms328 KiB
#include<bits/stdc++.h> #define IOS ios_base::sync_with_stdio(false);cin.tie();cout.tie(); #define all(x) x.begin(), x.end() #define int long long #define pq priority_queue #define eb emplace_back #define lb lower_bound #define ub upper_bound #define pb push_back #define pp pop_back #define F first #define S second using namespace std; int n, k; int a[300010]; int b[300010]; bool check(int m, int c = 0) { for (int i = 1; i <= n; i++) { int x = m / b[i]; if (b[i] * x < m) x++; c += k - x; } return c >= 0; } int search(int l, int r, int ans = 0) { while (l < r) { int m = (l + r) / 2; if (check(m)) {ans = m; l = m + 1;} else r = m - 1; } return ans; } void solve () { cin >> n >> k; for (int i = 1; i <= n; i++) cin >> a[i]; for (int i = 1; i <= n; i++) cin >> b[i]; cout << search(0, 2e18) << '\n'; } signed main() {IOS solve(); return 0;}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...