結果

問題 No.1808 Fullgold Alchemist
ユーザー titiatitia
提出日時 2022-01-14 21:31:08
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 360 bytes
コンパイル時間 198 ms
コンパイル使用メモリ 10,724 KB
実行使用メモリ 30,636 KB
最終ジャッジ日時 2023-08-12 17:45:35
合計ジャッジ時間 11,513 ms
ジャッジサーバーID
(参考情報)
judge9 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,848 KB
testcase_01 AC 17 ms
7,908 KB
testcase_02 AC 16 ms
7,760 KB
testcase_03 AC 16 ms
7,816 KB
testcase_04 AC 15 ms
7,752 KB
testcase_05 AC 51 ms
11,312 KB
testcase_06 AC 309 ms
20,556 KB
testcase_07 AC 68 ms
20,572 KB
testcase_08 WA -
testcase_09 AC 378 ms
30,504 KB
testcase_10 AC 133 ms
30,636 KB
testcase_11 AC 355 ms
29,976 KB
testcase_12 AC 81 ms
26,820 KB
testcase_13 AC 496 ms
26,712 KB
testcase_14 AC 426 ms
26,724 KB
testcase_15 AC 358 ms
26,740 KB
testcase_16 AC 27 ms
8,736 KB
testcase_17 AC 15 ms
7,860 KB
testcase_18 AC 74 ms
11,016 KB
testcase_19 AC 19 ms
8,344 KB
testcase_20 AC 127 ms
12,640 KB
testcase_21 AC 35 ms
9,844 KB
testcase_22 AC 15 ms
7,804 KB
testcase_23 AC 30 ms
9,268 KB
testcase_24 AC 28 ms
8,628 KB
testcase_25 AC 23 ms
8,776 KB
testcase_26 AC 162 ms
10,872 KB
testcase_27 AC 229 ms
12,124 KB
testcase_28 AC 541 ms
27,912 KB
testcase_29 AC 214 ms
14,488 KB
testcase_30 AC 168 ms
13,900 KB
testcase_31 AC 735 ms
25,804 KB
testcase_32 AC 358 ms
19,116 KB
testcase_33 AC 707 ms
22,940 KB
testcase_34 AC 642 ms
27,808 KB
testcase_35 AC 688 ms
21,452 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N,M=map(int,input().split())
A=list(map(int,input().split()))

OK=0
NG=max(A)

while NG>OK+1:
    mid=(OK+NG)//2

    now=0
    for a in A:
        now+=a
        now-=mid*M

        if now<0:
            NG=mid
            break
    else:
        if now<0:
            NG=mid
        else:
            OK=mid

print(OK)
0