답안 #634007

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
634007 2022-08-23T16:13:53 Z Astrayt Self Study (JOI22_ho_t2) C++17
0 / 100
324 ms 10880 KB
//君の手を握ってしまったら
//孤独を知らないこの街には
//もう二度と帰ってくることはできないのでしょう
//君が手を差し伸べた 光で影が生まれる
//歌って聞かせて この話の続き
//連れて行って見たことない星まで
//さユリ - 花の塔
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
#define starburst ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define pii pair<int,int>
#define pb push_back
#define ff first
#define ss second
//#define N 100005

void solve(){
    int N, M; cin >> N >> M;
    vector<int> A(N), B(N);
    for(auto &x:A) cin >> x;
    for(auto &x:B) cin >> x;
    for(int i = 0; i < N; ++i) A[i] = max(A[i], B[i]);
    int l = 0, r = 1e18 + 5;
    while(r != l){
        int s = 0, mid = 1 + (l + r) / 2;
        for(int i = 0, t = 0; i < N; ++i){
            t = mid;
            if(t >= M * A[i]) t -= A[i] * M, s += M;
            else {
                s += t / A[i];
                if(t % A[i]) s++;
                continue;
            }
            s += t / B[i];
            if(t % B[i]) s++;
        }
        if(s <= N * M) l = mid;
        else r = mid - 1;
    }
    cout << l << '\n';
}

signed main(){
    starburst
    int t = 1; //cin >> t;
    while(t--) solve();
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 324 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 320 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 320 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 3 ms 468 KB Output is correct
11 Correct 175 ms 10808 KB Output is correct
12 Correct 181 ms 10880 KB Output is correct
13 Correct 161 ms 8816 KB Output is correct
14 Incorrect 324 ms 8820 KB Output isn't correct
15 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 320 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 380 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 320 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 82 ms 2900 KB Output is correct
10 Correct 57 ms 2132 KB Output is correct
11 Correct 41 ms 1704 KB Output is correct
12 Correct 34 ms 1504 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 0 ms 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Incorrect 5 ms 340 KB Output isn't correct
19 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 324 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 320 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 320 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 3 ms 468 KB Output is correct
11 Correct 175 ms 10808 KB Output is correct
12 Correct 181 ms 10880 KB Output is correct
13 Correct 161 ms 8816 KB Output is correct
14 Incorrect 324 ms 8820 KB Output isn't correct
15 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 320 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 380 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 320 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 82 ms 2900 KB Output is correct
10 Correct 57 ms 2132 KB Output is correct
11 Correct 41 ms 1704 KB Output is correct
12 Correct 34 ms 1504 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 0 ms 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Incorrect 5 ms 340 KB Output isn't correct
19 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 324 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 320 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 320 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 3 ms 468 KB Output is correct
11 Correct 175 ms 10808 KB Output is correct
12 Correct 181 ms 10880 KB Output is correct
13 Correct 161 ms 8816 KB Output is correct
14 Incorrect 324 ms 8820 KB Output isn't correct
15 Halted 0 ms 0 KB -