# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
936704 |
2024-03-02T14:58:35 Z |
kitlix |
Self Study (JOI22_ho_t2) |
C++17 |
|
275 ms |
9804 KB |
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int INF = 1e18;
signed main() {
ios_base::sync_with_stdio(0), cin.tie(0);
int n, w;
cin >> n >> w;
vector<int> a(n), b(n);
for (auto& el : a)
cin >> el;
for (auto& el : b)
cin >> el;
for (int i = 0; i < n; ++i)
a[i] = max(a[i], b[i]);
int l = 0, r = INF;
while (l + 1 < r) {
int m = (l + r) / 2;
int extra = 0, need = 0;
for (int i = 0; i < n; ++i) {
if (a[i] * w >= m) {
extra += w - ((m + a[i] - 1) / a[i]);
continue;
}
need += (m - a[i] * w + b[i] - 1) / b[i];
}
if (extra >= need)
l = m;
else
r = m;
}
cout << l;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
428 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
3 ms |
620 KB |
Output is correct |
11 |
Correct |
145 ms |
9804 KB |
Output is correct |
12 |
Correct |
148 ms |
9560 KB |
Output is correct |
13 |
Correct |
134 ms |
8076 KB |
Output is correct |
14 |
Incorrect |
275 ms |
8272 KB |
Output isn't correct |
15 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
456 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
76 ms |
5204 KB |
Output is correct |
10 |
Correct |
49 ms |
3676 KB |
Output is correct |
11 |
Correct |
39 ms |
2904 KB |
Output is correct |
12 |
Correct |
30 ms |
2396 KB |
Output is correct |
13 |
Correct |
1 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
452 KB |
Output is correct |
18 |
Incorrect |
4 ms |
348 KB |
Output isn't correct |
19 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
428 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
3 ms |
620 KB |
Output is correct |
11 |
Correct |
145 ms |
9804 KB |
Output is correct |
12 |
Correct |
148 ms |
9560 KB |
Output is correct |
13 |
Correct |
134 ms |
8076 KB |
Output is correct |
14 |
Incorrect |
275 ms |
8272 KB |
Output isn't correct |
15 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
456 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
76 ms |
5204 KB |
Output is correct |
10 |
Correct |
49 ms |
3676 KB |
Output is correct |
11 |
Correct |
39 ms |
2904 KB |
Output is correct |
12 |
Correct |
30 ms |
2396 KB |
Output is correct |
13 |
Correct |
1 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
452 KB |
Output is correct |
18 |
Incorrect |
4 ms |
348 KB |
Output isn't correct |
19 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
428 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
3 ms |
620 KB |
Output is correct |
11 |
Correct |
145 ms |
9804 KB |
Output is correct |
12 |
Correct |
148 ms |
9560 KB |
Output is correct |
13 |
Correct |
134 ms |
8076 KB |
Output is correct |
14 |
Incorrect |
275 ms |
8272 KB |
Output isn't correct |
15 |
Halted |
0 ms |
0 KB |
- |