結果

問題 No.1808 Fullgold Alchemist
ユーザー hiragnhiragn
提出日時 2022-12-03 22:46:25
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,044 ms / 2,000 ms
コード長 479 bytes
コンパイル時間 221 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 32,564 KB
最終ジャッジ日時 2024-04-19 09:22:14
合計ジャッジ時間 8,097 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,624 KB
testcase_01 AC 29 ms
10,624 KB
testcase_02 AC 32 ms
10,624 KB
testcase_03 AC 32 ms
10,624 KB
testcase_04 AC 28 ms
10,496 KB
testcase_05 AC 71 ms
14,616 KB
testcase_06 AC 219 ms
26,320 KB
testcase_07 AC 98 ms
26,320 KB
testcase_08 AC 1,044 ms
32,524 KB
testcase_09 AC 263 ms
32,564 KB
testcase_10 AC 151 ms
32,436 KB
testcase_11 AC 263 ms
32,440 KB
testcase_12 AC 118 ms
28,308 KB
testcase_13 AC 329 ms
28,308 KB
testcase_14 AC 395 ms
28,388 KB
testcase_15 AC 267 ms
28,436 KB
testcase_16 AC 37 ms
11,008 KB
testcase_17 AC 30 ms
10,624 KB
testcase_18 AC 68 ms
13,228 KB
testcase_19 AC 30 ms
11,008 KB
testcase_20 AC 102 ms
14,732 KB
testcase_21 AC 49 ms
12,400 KB
testcase_22 AC 29 ms
10,624 KB
testcase_23 AC 40 ms
11,648 KB
testcase_24 AC 37 ms
10,880 KB
testcase_25 AC 35 ms
11,264 KB
testcase_26 AC 96 ms
14,132 KB
testcase_27 AC 113 ms
14,748 KB
testcase_28 AC 346 ms
30,600 KB
testcase_29 AC 139 ms
17,072 KB
testcase_30 AC 132 ms
16,476 KB
testcase_31 AC 433 ms
29,300 KB
testcase_32 AC 194 ms
21,412 KB
testcase_33 AC 440 ms
26,084 KB
testcase_34 AC 311 ms
31,084 KB
testcase_35 AC 319 ms
24,276 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import accumulate


def main():
    n, m = map(int, input().split())
    a = [0] + list(map(int, input().split()))
    acc = list(accumulate(a))

    def isok(k):
        return all(acc[i] >= m * k * i for i in range(n + 1))

    left = 0
    right = 10 ** 9 + 1
    while right - left > 1:
        mid = (left + right) // 2
        if isok(mid):
            left = mid
        else:
            right = mid
    print(left)


if __name__ == "__main__":
    main()
0