結果

問題 No.1808 Fullgold Alchemist
ユーザー KudeKude
提出日時 2022-01-14 21:29:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 105 ms / 2,000 ms
コード長 303 bytes
コンパイル時間 306 ms
コンパイル使用メモリ 82,828 KB
実行使用メモリ 104,116 KB
最終ジャッジ日時 2024-04-30 12:49:56
合計ジャッジ時間 3,696 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
52,504 KB
testcase_01 AC 35 ms
52,404 KB
testcase_02 AC 37 ms
52,288 KB
testcase_03 AC 32 ms
51,824 KB
testcase_04 AC 31 ms
53,212 KB
testcase_05 AC 64 ms
96,500 KB
testcase_06 AC 77 ms
103,676 KB
testcase_07 AC 70 ms
102,400 KB
testcase_08 AC 105 ms
102,212 KB
testcase_09 AC 100 ms
102,324 KB
testcase_10 AC 88 ms
102,412 KB
testcase_11 AC 93 ms
102,040 KB
testcase_12 AC 76 ms
102,580 KB
testcase_13 AC 84 ms
103,048 KB
testcase_14 AC 84 ms
103,084 KB
testcase_15 AC 80 ms
103,420 KB
testcase_16 AC 39 ms
61,308 KB
testcase_17 AC 34 ms
52,020 KB
testcase_18 AC 44 ms
67,200 KB
testcase_19 AC 39 ms
60,676 KB
testcase_20 AC 48 ms
71,304 KB
testcase_21 AC 41 ms
63,544 KB
testcase_22 AC 34 ms
52,488 KB
testcase_23 AC 40 ms
63,156 KB
testcase_24 AC 41 ms
60,632 KB
testcase_25 AC 39 ms
60,616 KB
testcase_26 AC 45 ms
66,672 KB
testcase_27 AC 46 ms
70,116 KB
testcase_28 AC 87 ms
104,116 KB
testcase_29 AC 53 ms
74,740 KB
testcase_30 AC 48 ms
72,876 KB
testcase_31 AC 78 ms
98,408 KB
testcase_32 AC 61 ms
83,592 KB
testcase_33 AC 72 ms
93,836 KB
testcase_34 AC 80 ms
102,940 KB
testcase_35 AC 69 ms
90,460 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