Submission #916335

# Submission time Handle Problem Language Result Execution time Memory
916335 2024-01-25T17:03:11 Z ace5 Self Study (JOI22_ho_t2) C++17
0 / 100
429 ms 10836 KB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n,m;
    cin >> n >> m;
    int64_t a[n],b[n];
    for(int i = 0;i < n;++i)
    {
        cin >> a[i];
    }
    for(int i = 0;i < n;++i)
    {
        cin >> b[i];
        if(a[i] < b[i])
            a[i] = b[i];
    }
    int64_t l = 0,r = 1e18;
    while(l < r)
    {
        int64_t mid = (l+r+1)/2;
        int64_t sv = 0;
        int64_t bv = 0;
        for(int j = 0;j < n;++j)
        {
            sv += max(int64_t(0),m-((mid+a[j]-1)/a[j]));
            bv += max(int64_t(0),(mid-m*a[j]+b[j]-1)/b[j]);
        }
        sv < bv ? r = mid-1 : l = mid;
    }
    cout << l;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 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 344 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 4 ms 428 KB Output is correct
11 Correct 249 ms 10836 KB Output is correct
12 Correct 247 ms 10832 KB Output is correct
13 Correct 236 ms 8716 KB Output is correct
14 Incorrect 429 ms 8936 KB Output isn't correct
15 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 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 460 KB Output is correct
7 Correct 0 ms 420 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 125 ms 5600 KB Output is correct
10 Correct 87 ms 3920 KB Output is correct
11 Correct 63 ms 2904 KB Output is correct
12 Correct 50 ms 2528 KB Output is correct
13 Correct 1 ms 344 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 456 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 456 KB Output is correct
18 Incorrect 8 ms 348 KB Output isn't correct
19 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 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 344 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 4 ms 428 KB Output is correct
11 Correct 249 ms 10836 KB Output is correct
12 Correct 247 ms 10832 KB Output is correct
13 Correct 236 ms 8716 KB Output is correct
14 Incorrect 429 ms 8936 KB Output isn't correct
15 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 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 460 KB Output is correct
7 Correct 0 ms 420 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 125 ms 5600 KB Output is correct
10 Correct 87 ms 3920 KB Output is correct
11 Correct 63 ms 2904 KB Output is correct
12 Correct 50 ms 2528 KB Output is correct
13 Correct 1 ms 344 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 456 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 456 KB Output is correct
18 Incorrect 8 ms 348 KB Output isn't correct
19 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 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 344 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 4 ms 428 KB Output is correct
11 Correct 249 ms 10836 KB Output is correct
12 Correct 247 ms 10832 KB Output is correct
13 Correct 236 ms 8716 KB Output is correct
14 Incorrect 429 ms 8936 KB Output isn't correct
15 Halted 0 ms 0 KB -