제출 #1233215

#제출 시각아이디문제언어결과실행 시간메모리
123321512345678Self Study (JOI22_ho_t2)C++17
54 / 100
111 ms5136 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long const int nx=3e5+5; ll n, m, a[nx], b[nx], l=1, r=1e18; bool check(ll x) { // return 1 when we can do x ll cnt=0; for (int i=1; i<=n; i++) { if (x%a[i]==0) cnt+=x/a[i]; else cnt+=x/a[i]+1; if (cnt>n*m) return 0; } return 1; } int main() { cin.tie(NULL)->sync_with_stdio(false); cin>>n>>m; for (int i=1; i<=n; i++) cin>>a[i]; for (int i=1; i<=n; i++) cin>>b[i]; while (l<r) { ll md=(l+r+1)/2; if (check(md)) l=md; else r=md-1; } cout<<l; }
#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...