結果

問題 No.1808 Fullgold Alchemist
ユーザー tktk_snsntktk_snsn
提出日時 2022-01-14 22:24:31
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 565 ms / 2,000 ms
コード長 334 bytes
コンパイル時間 185 ms
コンパイル使用メモリ 10,608 KB
実行使用メモリ 29,900 KB
最終ジャッジ日時 2023-08-12 20:38:00
合計ジャッジ時間 7,004 ms
ジャッジサーバーID
(参考情報)
judge8 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,800 KB
testcase_01 AC 16 ms
7,808 KB
testcase_02 AC 16 ms
7,832 KB
testcase_03 AC 16 ms
7,824 KB
testcase_04 AC 15 ms
7,788 KB
testcase_05 AC 50 ms
11,388 KB
testcase_06 AC 325 ms
20,420 KB
testcase_07 AC 67 ms
20,400 KB
testcase_08 AC 342 ms
29,840 KB
testcase_09 AC 342 ms
29,876 KB
testcase_10 AC 343 ms
29,872 KB
testcase_11 AC 565 ms
29,900 KB
testcase_12 AC 97 ms
27,960 KB
testcase_13 AC 303 ms
27,892 KB
testcase_14 AC 166 ms
28,112 KB
testcase_15 AC 252 ms
28,064 KB
testcase_16 AC 23 ms
8,684 KB
testcase_17 AC 15 ms
7,796 KB
testcase_18 AC 45 ms
10,984 KB
testcase_19 AC 17 ms
8,368 KB
testcase_20 AC 78 ms
12,788 KB
testcase_21 AC 35 ms
9,588 KB
testcase_22 AC 15 ms
7,944 KB
testcase_23 AC 34 ms
9,344 KB
testcase_24 AC 22 ms
8,596 KB
testcase_25 AC 24 ms
8,884 KB
testcase_26 AC 60 ms
11,236 KB
testcase_27 AC 83 ms
12,140 KB
testcase_28 AC 281 ms
28,156 KB
testcase_29 AC 101 ms
14,440 KB
testcase_30 AC 84 ms
13,864 KB
testcase_31 AC 280 ms
26,040 KB
testcase_32 AC 177 ms
19,008 KB
testcase_33 AC 224 ms
23,108 KB
testcase_34 AC 216 ms
27,608 KB
testcase_35 AC 185 ms
21,632 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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


def ok(n):
    rest = 0
    for a in A:
        a += rest
        if a < n:
            return False
        rest = a - n
    return True


l = 0
r = 10 ** 10
while r - l > 1:
    m = (r + l) // 2
    if ok(m):
        l = m
    else:
        r = m

print(l // M)
0