結果

問題 No.1808 Fullgold Alchemist
ユーザー KudeKude
提出日時 2022-01-14 21:29:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 145 ms / 2,000 ms
コード長 303 bytes
コンパイル時間 355 ms
コンパイル使用メモリ 87,156 KB
実行使用メモリ 107,432 KB
最終ジャッジ日時 2023-08-12 17:42:21
合計ジャッジ時間 5,824 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,216 KB
testcase_01 AC 72 ms
71,228 KB
testcase_02 AC 72 ms
71,228 KB
testcase_03 AC 73 ms
71,052 KB
testcase_04 AC 73 ms
71,008 KB
testcase_05 AC 104 ms
103,804 KB
testcase_06 AC 118 ms
107,432 KB
testcase_07 AC 112 ms
106,472 KB
testcase_08 AC 145 ms
99,732 KB
testcase_09 AC 129 ms
99,660 KB
testcase_10 AC 125 ms
99,672 KB
testcase_11 AC 130 ms
100,568 KB
testcase_12 AC 113 ms
106,104 KB
testcase_13 AC 123 ms
106,772 KB
testcase_14 AC 124 ms
106,820 KB
testcase_15 AC 120 ms
106,648 KB
testcase_16 AC 76 ms
76,328 KB
testcase_17 AC 69 ms
71,316 KB
testcase_18 AC 81 ms
79,612 KB
testcase_19 AC 75 ms
76,388 KB
testcase_20 AC 84 ms
81,932 KB
testcase_21 AC 78 ms
76,512 KB
testcase_22 AC 70 ms
71,320 KB
testcase_23 AC 78 ms
76,200 KB
testcase_24 AC 76 ms
76,320 KB
testcase_25 AC 75 ms
76,584 KB
testcase_26 AC 80 ms
78,748 KB
testcase_27 AC 84 ms
80,472 KB
testcase_28 AC 127 ms
99,936 KB
testcase_29 AC 89 ms
84,752 KB
testcase_30 AC 86 ms
83,380 KB
testcase_31 AC 122 ms
101,724 KB
testcase_32 AC 98 ms
91,148 KB
testcase_33 AC 115 ms
98,212 KB
testcase_34 AC 126 ms
99,944 KB
testcase_35 AC 107 ms
95,664 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
a = list(map(int, input().split()))
l = 0
r = 10 ** 9 + 1
while r - l > 1:
    c = (l + r) // 2
    carry = 0
    for x in a:
        x += carry
        if x < m * c:
            break
        carry = x - m * c
    else:
        l = c
        continue
    r = c
print(l)
0