結果

問題 No.1808 Fullgold Alchemist
ユーザー H3PO4H3PO4
提出日時 2022-01-14 21:31:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 98 ms / 2,000 ms
コード長 321 bytes
コンパイル時間 339 ms
コンパイル使用メモリ 82,448 KB
実行使用メモリ 112,436 KB
最終ジャッジ日時 2024-04-30 12:53:36
合計ジャッジ時間 3,777 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
53,620 KB
testcase_01 AC 32 ms
53,160 KB
testcase_02 AC 37 ms
53,268 KB
testcase_03 AC 32 ms
53,052 KB
testcase_04 AC 33 ms
52,744 KB
testcase_05 AC 73 ms
100,444 KB
testcase_06 AC 95 ms
112,320 KB
testcase_07 AC 86 ms
112,436 KB
testcase_08 AC 98 ms
102,092 KB
testcase_09 AC 92 ms
102,168 KB
testcase_10 AC 91 ms
101,956 KB
testcase_11 AC 91 ms
101,936 KB
testcase_12 AC 77 ms
105,156 KB
testcase_13 AC 91 ms
110,664 KB
testcase_14 AC 88 ms
110,264 KB
testcase_15 AC 90 ms
110,264 KB
testcase_16 AC 37 ms
59,496 KB
testcase_17 AC 33 ms
53,200 KB
testcase_18 AC 42 ms
66,576 KB
testcase_19 AC 36 ms
59,092 KB
testcase_20 AC 46 ms
70,500 KB
testcase_21 AC 38 ms
63,864 KB
testcase_22 AC 32 ms
52,764 KB
testcase_23 AC 38 ms
62,836 KB
testcase_24 AC 36 ms
59,644 KB
testcase_25 AC 36 ms
59,948 KB
testcase_26 AC 40 ms
66,296 KB
testcase_27 AC 45 ms
68,544 KB
testcase_28 AC 88 ms
103,856 KB
testcase_29 AC 50 ms
75,332 KB
testcase_30 AC 49 ms
73,264 KB
testcase_31 AC 89 ms
109,084 KB
testcase_32 AC 64 ms
86,112 KB
testcase_33 AC 72 ms
95,664 KB
testcase_34 AC 94 ms
104,360 KB
testcase_35 AC 67 ms
91,464 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