結果

問題 No.1139 Slime Race
ユーザー DriceDrice
提出日時 2020-07-31 21:46:03
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 518 bytes
コンパイル時間 192 ms
コンパイル使用メモリ 31,360 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-06 17:29:41
合計ジャッジ時間 1,533 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 3 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 24 ms
5,376 KB
testcase_11 AC 22 ms
5,376 KB
testcase_12 AC 26 ms
5,376 KB
testcase_13 AC 1 ms
5,376 KB
testcase_14 AC 23 ms
5,376 KB
testcase_15 WA -
testcase_16 AC 25 ms
5,376 KB
testcase_17 AC 23 ms
5,376 KB
testcase_18 AC 19 ms
5,376 KB
testcase_19 AC 13 ms
5,376 KB
testcase_20 AC 14 ms
5,376 KB
testcase_21 AC 18 ms
5,376 KB
testcase_22 AC 22 ms
5,376 KB
testcase_23 WA -
testcase_24 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<cstdio>

int main(){
    int n; long long d;
    scanf("%d%lld",&n,&d);
    for(int i = 1; i <= n; i++){
        int x;
        scanf("%d",&x);
    }
    long long sum = 0;
    for(int i = 1; i <= n; i++){
        long long u;
        scanf("%lld",&u);
        sum += u;
    }
    int L = 1, R = d;
    long long res = -1;
    while(L<=R){
        int M = (L+R)/2;
        if(sum*M>=d){
            res = M;
            R = M-1;
        }
        else L = M+1;
    }
    printf("%lld\n",res);
    return 0;
}
0