結果

問題 No.1808 Fullgold Alchemist
ユーザー H3PO4H3PO4
提出日時 2022-01-14 21:31:24
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 138 ms / 2,000 ms
コード長 321 bytes
コンパイル時間 512 ms
コンパイル使用メモリ 87,276 KB
実行使用メモリ 108,072 KB
最終ジャッジ日時 2023-08-12 17:45:52
合計ジャッジ時間 5,748 ms
ジャッジサーバーID
(参考情報)
judge11 / judge9
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,060 KB
testcase_01 AC 71 ms
71,420 KB
testcase_02 AC 70 ms
71,400 KB
testcase_03 AC 72 ms
71,392 KB
testcase_04 AC 73 ms
71,412 KB
testcase_05 AC 107 ms
105,208 KB
testcase_06 AC 125 ms
104,372 KB
testcase_07 AC 122 ms
104,272 KB
testcase_08 AC 138 ms
101,004 KB
testcase_09 AC 133 ms
101,024 KB
testcase_10 AC 126 ms
101,056 KB
testcase_11 AC 130 ms
101,144 KB
testcase_12 AC 127 ms
107,952 KB
testcase_13 AC 137 ms
108,056 KB
testcase_14 AC 135 ms
108,072 KB
testcase_15 AC 136 ms
108,056 KB
testcase_16 AC 75 ms
75,792 KB
testcase_17 AC 74 ms
71,404 KB
testcase_18 AC 83 ms
79,368 KB
testcase_19 AC 75 ms
75,892 KB
testcase_20 AC 85 ms
81,844 KB
testcase_21 AC 79 ms
76,100 KB
testcase_22 AC 72 ms
71,180 KB
testcase_23 AC 77 ms
75,792 KB
testcase_24 AC 76 ms
75,844 KB
testcase_25 AC 75 ms
75,948 KB
testcase_26 AC 81 ms
78,304 KB
testcase_27 AC 83 ms
80,372 KB
testcase_28 AC 129 ms
99,868 KB
testcase_29 AC 91 ms
84,404 KB
testcase_30 AC 88 ms
83,456 KB
testcase_31 AC 122 ms
100,588 KB
testcase_32 AC 102 ms
91,560 KB
testcase_33 AC 112 ms
99,004 KB
testcase_34 AC 130 ms
99,768 KB
testcase_35 AC 108 ms
96,328 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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


def isOK(x):
    cur = 0
    for a in A:
        cur += a - x
        if cur < 0:
            return False
    return True


l, r = 0, 10 ** 18
while r - l > 1:
    m = (r + l) // 2
    if isOK(m * M):
        l = m
    else:
        r = m
print(l)
0