結果

問題 No.1139 Slime Race
ユーザー DriceDrice
提出日時 2020-07-31 21:48:10
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 530 bytes
コンパイル時間 135 ms
コンパイル使用メモリ 31,136 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-20 22:48:46
合計ジャッジ時間 1,479 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 21 ms
4,380 KB
testcase_11 AC 19 ms
4,380 KB
testcase_12 AC 24 ms
4,376 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 21 ms
4,376 KB
testcase_15 WA -
testcase_16 AC 24 ms
4,376 KB
testcase_17 AC 21 ms
4,376 KB
testcase_18 AC 18 ms
4,376 KB
testcase_19 AC 13 ms
4,376 KB
testcase_20 AC 13 ms
4,376 KB
testcase_21 AC 17 ms
4,376 KB
testcase_22 AC 21 ms
4,376 KB
testcase_23 WA -
testcase_24 AC 2 ms
4,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;
    }
    long long L = 1, R = d;
    long long res = -1;
    while(L<=R){
        long long M = (L+R)/2;
        if(sum*M>=d){
            res = M;
            R = M-1;
        }
        else L = M+1;
    }
    printf("%lld\n",res);
    return 0;
}
0