답안 #703590

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
703590 2023-02-27T18:18:38 Z niter Self Study (JOI22_ho_t2) C++14
62 / 100
253 ms 4976 KB
#include <iostream>
#include <vector>
#define loop(i,a,b) for(int i=a;i<b;i++)
using namespace std;
long long A[300050], B[300050];

int main(){
    int N, M;
    cin >> N >> M;
    loop(i,0,N) cin >> A[i];
    loop(i,0,N) cin >> B[i];
    loop(i,0,N) A[i] = max(A[i], B[i]);

    long long ok = 0, ng = 1LL << 60;
    auto check = [&](long long x) -> bool {
        long long day = 0;
        for(int i = 0; i < N; i++){
            if(x <= A[i] * M) day += (x + A[i] - 1) / A[i];
            else day += M + (x - A[i] * M + B[i] - 1) / B[i];
            if(day > N * M) return 0;
        }
        return 1;
    };
    while(ng >= ok + 2){
        long long mid = (ng + ok) / 2;
        if(check(mid)) ok = mid;
        else ng = mid;
    }
    cout << ok << endl;
    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 1 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 224 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 4 ms 340 KB Output is correct
11 Correct 243 ms 4920 KB Output is correct
12 Correct 243 ms 4964 KB Output is correct
13 Correct 181 ms 4976 KB Output is correct
14 Correct 171 ms 4968 KB Output is correct
15 Correct 0 ms 212 KB Output is correct
16 Correct 80 ms 4972 KB Output is correct
17 Correct 253 ms 4940 KB Output is correct
18 Correct 244 ms 4964 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 80 ms 4972 KB Output is correct
3 Correct 253 ms 4940 KB Output is correct
4 Correct 244 ms 4964 KB Output is correct
5 Correct 1 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 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 121 ms 2576 KB Output is correct
14 Correct 83 ms 1816 KB Output is correct
15 Correct 60 ms 1356 KB Output is correct
16 Correct 51 ms 1136 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Correct 0 ms 212 KB Output is correct
21 Correct 0 ms 260 KB Output is correct
22 Correct 2 ms 340 KB Output is correct
23 Correct 5 ms 340 KB Output is correct
# 결과 실행 시간 메모리 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 1 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 224 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 4 ms 340 KB Output is correct
11 Correct 243 ms 4920 KB Output is correct
12 Correct 243 ms 4964 KB Output is correct
13 Correct 181 ms 4976 KB Output is correct
14 Correct 171 ms 4968 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 0 ms 212 KB Output is correct
17 Correct 0 ms 212 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Correct 0 ms 212 KB Output is correct
21 Correct 0 ms 212 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
23 Correct 121 ms 2576 KB Output is correct
24 Correct 83 ms 1816 KB Output is correct
25 Correct 60 ms 1356 KB Output is correct
26 Correct 51 ms 1136 KB Output is correct
27 Correct 1 ms 212 KB Output is correct
28 Correct 0 ms 212 KB Output is correct
29 Correct 0 ms 212 KB Output is correct
30 Correct 0 ms 212 KB Output is correct
31 Correct 0 ms 260 KB Output is correct
32 Correct 2 ms 340 KB Output is correct
33 Correct 5 ms 340 KB Output is correct
34 Correct 0 ms 212 KB Output is correct
35 Correct 80 ms 4972 KB Output is correct
36 Correct 253 ms 4940 KB Output is correct
37 Correct 244 ms 4964 KB Output is correct
38 Correct 0 ms 212 KB Output is correct
39 Correct 0 ms 212 KB Output is correct
40 Correct 0 ms 212 KB Output is correct
41 Correct 0 ms 212 KB Output is correct
42 Correct 1 ms 212 KB Output is correct
43 Correct 1 ms 212 KB Output is correct
44 Correct 0 ms 212 KB Output is correct
45 Correct 6 ms 340 KB Output is correct
46 Correct 8 ms 340 KB Output is correct
47 Correct 1 ms 212 KB Output is correct
48 Correct 42 ms 1100 KB Output is correct
49 Correct 0 ms 212 KB Output is correct
50 Correct 0 ms 212 KB Output is correct
51 Correct 5 ms 340 KB Output is correct
52 Correct 0 ms 212 KB Output is correct
53 Correct 0 ms 212 KB Output is correct
54 Correct 0 ms 212 KB Output is correct
55 Correct 124 ms 2600 KB Output is correct
56 Correct 62 ms 1756 KB Output is correct
57 Correct 55 ms 1740 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 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 0 ms 212 KB Output is correct
9 Correct 121 ms 2576 KB Output is correct
10 Correct 83 ms 1816 KB Output is correct
11 Correct 60 ms 1356 KB Output is correct
12 Correct 51 ms 1136 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 0 ms 212 KB Output is correct
16 Correct 0 ms 212 KB Output is correct
17 Correct 0 ms 260 KB Output is correct
18 Correct 2 ms 340 KB Output is correct
19 Correct 5 ms 340 KB Output is correct
20 Correct 0 ms 212 KB Output is correct
21 Correct 80 ms 4972 KB Output is correct
22 Correct 253 ms 4940 KB Output is correct
23 Correct 244 ms 4964 KB Output is correct
24 Incorrect 42 ms 900 KB Output isn't correct
25 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 1 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 224 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 4 ms 340 KB Output is correct
11 Correct 243 ms 4920 KB Output is correct
12 Correct 243 ms 4964 KB Output is correct
13 Correct 181 ms 4976 KB Output is correct
14 Correct 171 ms 4968 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 0 ms 212 KB Output is correct
17 Correct 0 ms 212 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Correct 0 ms 212 KB Output is correct
21 Correct 0 ms 212 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
23 Correct 121 ms 2576 KB Output is correct
24 Correct 83 ms 1816 KB Output is correct
25 Correct 60 ms 1356 KB Output is correct
26 Correct 51 ms 1136 KB Output is correct
27 Correct 1 ms 212 KB Output is correct
28 Correct 0 ms 212 KB Output is correct
29 Correct 0 ms 212 KB Output is correct
30 Correct 0 ms 212 KB Output is correct
31 Correct 0 ms 260 KB Output is correct
32 Correct 2 ms 340 KB Output is correct
33 Correct 5 ms 340 KB Output is correct
34 Correct 0 ms 212 KB Output is correct
35 Correct 0 ms 212 KB Output is correct
36 Correct 0 ms 212 KB Output is correct
37 Correct 0 ms 212 KB Output is correct
38 Correct 1 ms 212 KB Output is correct
39 Correct 1 ms 212 KB Output is correct
40 Correct 0 ms 212 KB Output is correct
41 Correct 6 ms 340 KB Output is correct
42 Correct 8 ms 340 KB Output is correct
43 Correct 1 ms 212 KB Output is correct
44 Correct 42 ms 1100 KB Output is correct
45 Correct 0 ms 212 KB Output is correct
46 Correct 0 ms 212 KB Output is correct
47 Correct 5 ms 340 KB Output is correct
48 Correct 0 ms 212 KB Output is correct
49 Correct 0 ms 212 KB Output is correct
50 Correct 0 ms 212 KB Output is correct
51 Correct 124 ms 2600 KB Output is correct
52 Correct 62 ms 1756 KB Output is correct
53 Correct 55 ms 1740 KB Output is correct
54 Incorrect 42 ms 900 KB Output isn't correct
55 Halted 0 ms 0 KB -