답안 #1015637

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1015637 2024-07-06T15:51:05 Z snpmrnhlol Self Study (JOI22_ho_t2) C++17
0 / 100
201 ms 10832 KB
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N = 3e5;
const ll inf = 1e18;
ll v[N],v2[N];
int main(){
    ll n,m;
    cin>>n>>m;
    for(ll i = 0;i < n;i++){
        cin>>v[i];
    }
    for(ll i = 0;i < n;i++){
        cin>>v2[i];
        v[i] = max(v[i],v2[i]);
    }
    ll l = 0,r = inf;
    while(l != r){
        ll mij = (l + r + 1)/2;
        ll bonus = 0,req = 0;
        for(ll i = 0;i < n;i++){
            ll req2 = (mij + v[i] - 1)/v[i];
            if(req2 <= m)bonus+=m - req2;
            else{
                req+=(mij - m*v[i] + v2[i] - 1)/v2[i];
            }
        }
        //cout<<mij<<' '<<bonus<<' '<<req<<'\n';
        if(bonus >= req){
            l = mij;
        }else r = mij - 1;
    }
    cout<<l<<'\n';
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2396 KB Output is correct
2 Correct 0 ms 2396 KB Output is correct
3 Correct 1 ms 2396 KB Output is correct
4 Correct 0 ms 2396 KB Output is correct
5 Correct 1 ms 2396 KB Output is correct
6 Correct 0 ms 2396 KB Output is correct
7 Correct 0 ms 2396 KB Output is correct
8 Correct 0 ms 2396 KB Output is correct
9 Correct 0 ms 2484 KB Output is correct
10 Correct 4 ms 2392 KB Output is correct
11 Correct 195 ms 8632 KB Output is correct
12 Correct 201 ms 10832 KB Output is correct
13 Correct 171 ms 8788 KB Output is correct
14 Incorrect 195 ms 8784 KB Output isn't correct
15 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 2396 KB Output is correct
2 Correct 0 ms 2396 KB Output is correct
3 Correct 1 ms 2396 KB Output is correct
4 Correct 0 ms 2396 KB Output is correct
5 Correct 1 ms 2396 KB Output is correct
6 Correct 0 ms 2396 KB Output is correct
7 Correct 0 ms 2396 KB Output is correct
8 Correct 1 ms 2396 KB Output is correct
9 Correct 102 ms 4540 KB Output is correct
10 Correct 68 ms 4700 KB Output is correct
11 Correct 51 ms 2896 KB Output is correct
12 Correct 45 ms 2936 KB Output is correct
13 Correct 1 ms 2396 KB Output is correct
14 Correct 1 ms 2392 KB Output is correct
15 Correct 1 ms 2392 KB Output is correct
16 Correct 1 ms 2396 KB Output is correct
17 Correct 1 ms 2396 KB Output is correct
18 Incorrect 3 ms 2396 KB Output isn't correct
19 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2396 KB Output is correct
2 Correct 0 ms 2396 KB Output is correct
3 Correct 1 ms 2396 KB Output is correct
4 Correct 0 ms 2396 KB Output is correct
5 Correct 1 ms 2396 KB Output is correct
6 Correct 0 ms 2396 KB Output is correct
7 Correct 0 ms 2396 KB Output is correct
8 Correct 0 ms 2396 KB Output is correct
9 Correct 0 ms 2484 KB Output is correct
10 Correct 4 ms 2392 KB Output is correct
11 Correct 195 ms 8632 KB Output is correct
12 Correct 201 ms 10832 KB Output is correct
13 Correct 171 ms 8788 KB Output is correct
14 Incorrect 195 ms 8784 KB Output isn't correct
15 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 2396 KB Output is correct
2 Correct 0 ms 2396 KB Output is correct
3 Correct 1 ms 2396 KB Output is correct
4 Correct 0 ms 2396 KB Output is correct
5 Correct 1 ms 2396 KB Output is correct
6 Correct 0 ms 2396 KB Output is correct
7 Correct 0 ms 2396 KB Output is correct
8 Correct 1 ms 2396 KB Output is correct
9 Correct 102 ms 4540 KB Output is correct
10 Correct 68 ms 4700 KB Output is correct
11 Correct 51 ms 2896 KB Output is correct
12 Correct 45 ms 2936 KB Output is correct
13 Correct 1 ms 2396 KB Output is correct
14 Correct 1 ms 2392 KB Output is correct
15 Correct 1 ms 2392 KB Output is correct
16 Correct 1 ms 2396 KB Output is correct
17 Correct 1 ms 2396 KB Output is correct
18 Incorrect 3 ms 2396 KB Output isn't correct
19 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2396 KB Output is correct
2 Correct 0 ms 2396 KB Output is correct
3 Correct 1 ms 2396 KB Output is correct
4 Correct 0 ms 2396 KB Output is correct
5 Correct 1 ms 2396 KB Output is correct
6 Correct 0 ms 2396 KB Output is correct
7 Correct 0 ms 2396 KB Output is correct
8 Correct 0 ms 2396 KB Output is correct
9 Correct 0 ms 2484 KB Output is correct
10 Correct 4 ms 2392 KB Output is correct
11 Correct 195 ms 8632 KB Output is correct
12 Correct 201 ms 10832 KB Output is correct
13 Correct 171 ms 8788 KB Output is correct
14 Incorrect 195 ms 8784 KB Output isn't correct
15 Halted 0 ms 0 KB -