이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define int int64_t
int n, m;
// bool check(int pos, vector<int>&a, vector<int>&b) {
// int free = 0;
// int req = 0;
// for (int i=0; i<n; i++) {
// int thisNeedsFromA = (pos+a[i]-1)/a[i];
// if (thisNeedsFromA <= m) {
// free += m-thisNeedsFromA;
// }
// else {
// req += (pos-a[i]*m + b[i]-1)/b[i];
// }
// }
// return free >= req;
// }
signed main() {
cin.tie(0);
ios_base::sync_with_stdio(0);
cin >> n >> m;
vector<int> a(n), b(n);
for (int i = 0; i<n; i++) cin >> a[i];
for (int i = 0; i<n; i++) cin >> b[i];
for (int i = 0; i<n; i++) a[i] = max(a[i], b[i]);
cout << *min_element(a.begin(), a.end()) << "\n";
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |