답안 #871124

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
871124 2023-11-10T00:48:07 Z Marco_Escandon Self Study (JOI22_ho_t2) C++11
100 / 100
390 ms 20944 KB
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ll n1,m1;
    cin>>n1>>m1;
    __int128_t n=n1,m=m1;
    __int128_t cad[3][n];
    for(int j=0; j<n; j++)
    {
        ll temp;
        cin>>temp;
        cad[0][j]=temp;
    }
    for(int j=0; j<n; j++)
    {
        ll temp;
        cin>>temp;
        cad[1][j]=temp;
        cad[0][j]=max(cad[1][j],cad[0][j]);
        cad[2][j]=cad[0][j]*m;
    }
    __int128_t a=0,b=5e20;
    while(a-b!=1&&a-b!=-1)
    {
        __int128_t m=(a+b)/2;
        __int128_t op=0;
        for(int i=0; i<n; i++)
        {
            if(cad[2][i]>m)
                op+=(cad[2][i]-m)/cad[0][i];
        }
        for(int i=0; i<n; i++)
        {
            if(cad[2][i]<m)
            {
                op-=(m-cad[2][i]+cad[1][i]-1)/cad[1][i];
            }
        }
        if(op>=0)
            a=m;
        else b=m;
    }
    cout<<(ll)b-1;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 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 344 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 0 ms 348 KB Output is correct
10 Correct 5 ms 724 KB Output is correct
11 Correct 312 ms 20384 KB Output is correct
12 Correct 311 ms 20292 KB Output is correct
13 Correct 268 ms 18516 KB Output is correct
14 Correct 332 ms 18304 KB Output is correct
15 Correct 1 ms 344 KB Output is correct
16 Correct 287 ms 15664 KB Output is correct
17 Correct 323 ms 20820 KB Output is correct
18 Correct 320 ms 20444 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 287 ms 15664 KB Output is correct
3 Correct 323 ms 20820 KB Output is correct
4 Correct 320 ms 20444 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
6 Correct 1 ms 344 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 432 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 166 ms 10120 KB Output is correct
14 Correct 108 ms 7248 KB Output is correct
15 Correct 80 ms 5200 KB Output is correct
16 Correct 66 ms 4384 KB Output is correct
17 Correct 1 ms 344 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 5 ms 664 KB Output is correct
23 Correct 5 ms 752 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 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 344 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 0 ms 348 KB Output is correct
10 Correct 5 ms 724 KB Output is correct
11 Correct 312 ms 20384 KB Output is correct
12 Correct 311 ms 20292 KB Output is correct
13 Correct 268 ms 18516 KB Output is correct
14 Correct 332 ms 18304 KB Output is correct
15 Correct 0 ms 344 KB Output is correct
16 Correct 1 ms 344 KB Output is correct
17 Correct 0 ms 344 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 0 ms 432 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 166 ms 10120 KB Output is correct
24 Correct 108 ms 7248 KB Output is correct
25 Correct 80 ms 5200 KB Output is correct
26 Correct 66 ms 4384 KB Output is correct
27 Correct 1 ms 344 KB Output is correct
28 Correct 0 ms 348 KB Output is correct
29 Correct 0 ms 348 KB Output is correct
30 Correct 0 ms 348 KB Output is correct
31 Correct 0 ms 348 KB Output is correct
32 Correct 5 ms 664 KB Output is correct
33 Correct 5 ms 752 KB Output is correct
34 Correct 1 ms 344 KB Output is correct
35 Correct 287 ms 15664 KB Output is correct
36 Correct 323 ms 20820 KB Output is correct
37 Correct 320 ms 20444 KB Output is correct
38 Correct 0 ms 348 KB Output is correct
39 Correct 0 ms 344 KB Output is correct
40 Correct 0 ms 348 KB Output is correct
41 Correct 0 ms 348 KB Output is correct
42 Correct 0 ms 344 KB Output is correct
43 Correct 0 ms 348 KB Output is correct
44 Correct 0 ms 348 KB Output is correct
45 Correct 6 ms 604 KB Output is correct
46 Correct 10 ms 856 KB Output is correct
47 Correct 1 ms 348 KB Output is correct
48 Correct 55 ms 3592 KB Output is correct
49 Correct 0 ms 348 KB Output is correct
50 Correct 0 ms 348 KB Output is correct
51 Correct 5 ms 704 KB Output is correct
52 Correct 0 ms 348 KB Output is correct
53 Correct 0 ms 348 KB Output is correct
54 Correct 1 ms 344 KB Output is correct
55 Correct 158 ms 10052 KB Output is correct
56 Correct 104 ms 6224 KB Output is correct
57 Correct 110 ms 6224 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 0 ms 344 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 432 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 166 ms 10120 KB Output is correct
10 Correct 108 ms 7248 KB Output is correct
11 Correct 80 ms 5200 KB Output is correct
12 Correct 66 ms 4384 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 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 5 ms 664 KB Output is correct
19 Correct 5 ms 752 KB Output is correct
20 Correct 1 ms 344 KB Output is correct
21 Correct 287 ms 15664 KB Output is correct
22 Correct 323 ms 20820 KB Output is correct
23 Correct 320 ms 20444 KB Output is correct
24 Correct 58 ms 3420 KB Output is correct
25 Correct 155 ms 9152 KB Output is correct
26 Correct 35 ms 2396 KB Output is correct
27 Correct 315 ms 20048 KB Output is correct
28 Correct 342 ms 20304 KB Output is correct
29 Correct 324 ms 20052 KB Output is correct
30 Correct 341 ms 20356 KB Output is correct
31 Correct 390 ms 20236 KB Output is correct
32 Correct 285 ms 15700 KB Output is correct
33 Correct 318 ms 20944 KB Output is correct
34 Correct 291 ms 15664 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 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 344 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 0 ms 348 KB Output is correct
10 Correct 5 ms 724 KB Output is correct
11 Correct 312 ms 20384 KB Output is correct
12 Correct 311 ms 20292 KB Output is correct
13 Correct 268 ms 18516 KB Output is correct
14 Correct 332 ms 18304 KB Output is correct
15 Correct 0 ms 344 KB Output is correct
16 Correct 1 ms 344 KB Output is correct
17 Correct 0 ms 344 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 0 ms 432 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 166 ms 10120 KB Output is correct
24 Correct 108 ms 7248 KB Output is correct
25 Correct 80 ms 5200 KB Output is correct
26 Correct 66 ms 4384 KB Output is correct
27 Correct 1 ms 344 KB Output is correct
28 Correct 0 ms 348 KB Output is correct
29 Correct 0 ms 348 KB Output is correct
30 Correct 0 ms 348 KB Output is correct
31 Correct 0 ms 348 KB Output is correct
32 Correct 5 ms 664 KB Output is correct
33 Correct 5 ms 752 KB Output is correct
34 Correct 0 ms 348 KB Output is correct
35 Correct 0 ms 344 KB Output is correct
36 Correct 0 ms 348 KB Output is correct
37 Correct 0 ms 348 KB Output is correct
38 Correct 0 ms 344 KB Output is correct
39 Correct 0 ms 348 KB Output is correct
40 Correct 0 ms 348 KB Output is correct
41 Correct 6 ms 604 KB Output is correct
42 Correct 10 ms 856 KB Output is correct
43 Correct 1 ms 348 KB Output is correct
44 Correct 55 ms 3592 KB Output is correct
45 Correct 0 ms 348 KB Output is correct
46 Correct 0 ms 348 KB Output is correct
47 Correct 5 ms 704 KB Output is correct
48 Correct 0 ms 348 KB Output is correct
49 Correct 0 ms 348 KB Output is correct
50 Correct 1 ms 344 KB Output is correct
51 Correct 158 ms 10052 KB Output is correct
52 Correct 104 ms 6224 KB Output is correct
53 Correct 110 ms 6224 KB Output is correct
54 Correct 58 ms 3420 KB Output is correct
55 Correct 155 ms 9152 KB Output is correct
56 Correct 35 ms 2396 KB Output is correct
57 Correct 315 ms 20048 KB Output is correct
58 Correct 342 ms 20304 KB Output is correct
59 Correct 324 ms 20052 KB Output is correct
60 Correct 341 ms 20356 KB Output is correct
61 Correct 390 ms 20236 KB Output is correct
62 Correct 285 ms 15700 KB Output is correct
63 Correct 318 ms 20944 KB Output is correct
64 Correct 291 ms 15664 KB Output is correct
65 Correct 1 ms 344 KB Output is correct
66 Correct 287 ms 15664 KB Output is correct
67 Correct 323 ms 20820 KB Output is correct
68 Correct 320 ms 20444 KB Output is correct
69 Correct 41 ms 2396 KB Output is correct
70 Correct 10 ms 860 KB Output is correct
71 Correct 0 ms 348 KB Output is correct
72 Correct 53 ms 3160 KB Output is correct
73 Correct 12 ms 860 KB Output is correct
74 Correct 1 ms 348 KB Output is correct
75 Correct 322 ms 20056 KB Output is correct
76 Correct 332 ms 20292 KB Output is correct
77 Correct 336 ms 20232 KB Output is correct
78 Correct 356 ms 20252 KB Output is correct
79 Correct 385 ms 20116 KB Output is correct
80 Correct 378 ms 20288 KB Output is correct
81 Correct 267 ms 18500 KB Output is correct
82 Correct 305 ms 18256 KB Output is correct