#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;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
0 ms |
212 KB |
Output is correct |
10 |
Correct |
1 ms |
340 KB |
Output is correct |
11 |
Correct |
55 ms |
5008 KB |
Output is correct |
12 |
Correct |
70 ms |
5008 KB |
Output is correct |
13 |
Correct |
52 ms |
4948 KB |
Output is correct |
14 |
Correct |
54 ms |
4948 KB |
Output is correct |
15 |
Correct |
1 ms |
212 KB |
Output is correct |
16 |
Correct |
38 ms |
6228 KB |
Output is correct |
17 |
Correct |
77 ms |
11524 KB |
Output is correct |
18 |
Correct |
59 ms |
10828 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
38 ms |
6228 KB |
Output is correct |
3 |
Correct |
77 ms |
11524 KB |
Output is correct |
4 |
Correct |
59 ms |
10828 KB |
Output is correct |
5 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
6 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
0 ms |
212 KB |
Output is correct |
10 |
Correct |
1 ms |
340 KB |
Output is correct |
11 |
Correct |
55 ms |
5008 KB |
Output is correct |
12 |
Correct |
70 ms |
5008 KB |
Output is correct |
13 |
Correct |
52 ms |
4948 KB |
Output is correct |
14 |
Correct |
54 ms |
4948 KB |
Output is correct |
15 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
16 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
0 ms |
212 KB |
Output is correct |
10 |
Correct |
1 ms |
340 KB |
Output is correct |
11 |
Correct |
55 ms |
5008 KB |
Output is correct |
12 |
Correct |
70 ms |
5008 KB |
Output is correct |
13 |
Correct |
52 ms |
4948 KB |
Output is correct |
14 |
Correct |
54 ms |
4948 KB |
Output is correct |
15 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
16 |
Halted |
0 ms |
0 KB |
- |