結果

問題 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  
実行時間 678 ms / 2,000 ms
コード長 334 bytes
コンパイル時間 120 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 32,692 KB
最終ジャッジ日時 2024-04-30 15:43:13
合計ジャッジ時間 7,322 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
10,752 KB
testcase_01 AC 27 ms
10,752 KB
testcase_02 AC 24 ms
10,752 KB
testcase_03 AC 26 ms
10,752 KB
testcase_04 AC 27 ms
10,752 KB
testcase_05 AC 67 ms
14,020 KB
testcase_06 AC 386 ms
23,196 KB
testcase_07 AC 76 ms
23,212 KB
testcase_08 AC 396 ms
32,692 KB
testcase_09 AC 408 ms
32,688 KB
testcase_10 AC 397 ms
32,560 KB
testcase_11 AC 678 ms
32,688 KB
testcase_12 AC 109 ms
28,564 KB
testcase_13 AC 363 ms
28,556 KB
testcase_14 AC 193 ms
28,572 KB
testcase_15 AC 306 ms
28,564 KB
testcase_16 AC 35 ms
11,136 KB
testcase_17 AC 27 ms
10,752 KB
testcase_18 AC 59 ms
13,352 KB
testcase_19 AC 27 ms
10,880 KB
testcase_20 AC 100 ms
14,948 KB
testcase_21 AC 47 ms
12,160 KB
testcase_22 AC 25 ms
10,752 KB
testcase_23 AC 46 ms
11,904 KB
testcase_24 AC 31 ms
11,136 KB
testcase_25 AC 34 ms
11,264 KB
testcase_26 AC 76 ms
13,628 KB
testcase_27 AC 101 ms
14,832 KB
testcase_28 AC 326 ms
30,852 KB
testcase_29 AC 123 ms
17,172 KB
testcase_30 AC 101 ms
16,596 KB
testcase_31 AC 336 ms
28,684 KB
testcase_32 AC 211 ms
21,536 KB
testcase_33 AC 263 ms
25,476 KB
testcase_34 AC 246 ms
30,520 KB
testcase_35 AC 216 ms
24,180 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