結果

問題 No.1808 Fullgold Alchemist
ユーザー ryusukeryusuke
提出日時 2023-04-18 20:37:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 320 ms / 2,000 ms
コード長 653 bytes
コンパイル時間 578 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 105,984 KB
最終ジャッジ日時 2024-04-21 21:55:49
合計ジャッジ時間 8,970 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 49 ms
51,712 KB
testcase_01 AC 49 ms
51,712 KB
testcase_02 AC 49 ms
52,096 KB
testcase_03 AC 49 ms
51,840 KB
testcase_04 AC 48 ms
52,096 KB
testcase_05 AC 248 ms
103,296 KB
testcase_06 AC 292 ms
105,984 KB
testcase_07 AC 271 ms
105,984 KB
testcase_08 AC 301 ms
102,528 KB
testcase_09 AC 302 ms
102,272 KB
testcase_10 AC 303 ms
102,144 KB
testcase_11 AC 320 ms
101,888 KB
testcase_12 AC 271 ms
105,600 KB
testcase_13 AC 292 ms
105,472 KB
testcase_14 AC 273 ms
105,728 KB
testcase_15 AC 284 ms
105,600 KB
testcase_16 AC 71 ms
67,200 KB
testcase_17 AC 50 ms
51,840 KB
testcase_18 AC 107 ms
78,592 KB
testcase_19 AC 65 ms
63,232 KB
testcase_20 AC 119 ms
80,896 KB
testcase_21 AC 91 ms
75,904 KB
testcase_22 AC 54 ms
57,984 KB
testcase_23 AC 87 ms
75,392 KB
testcase_24 AC 70 ms
68,352 KB
testcase_25 AC 72 ms
68,992 KB
testcase_26 AC 103 ms
77,952 KB
testcase_27 AC 118 ms
79,616 KB
testcase_28 AC 302 ms
103,936 KB
testcase_29 AC 137 ms
83,712 KB
testcase_30 AC 128 ms
82,176 KB
testcase_31 AC 252 ms
100,480 KB
testcase_32 AC 187 ms
90,112 KB
testcase_33 AC 242 ms
97,280 KB
testcase_34 AC 274 ms
103,808 KB
testcase_35 AC 224 ms
94,720 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# verification-helper: PROBLEM https://yukicoder.me/problems/no/1808

def is_ok(k: int) -> bool:
    check = True
    cnt = 0
    for i in range(n):
        cnt += a[i]
        if cnt >= k * (i + 1): continue
        check = False

    return check


def binary_search(left: int, right: int) -> int:
    while right - left > 1:
        mid = (left + right) // 2
        if is_ok(mid):
            left = mid
        else:
            right = mid

    return left


def main():
    global n, a

    n, m = map(int, input().split())
    a = list(map(int, input().split()))

    print(binary_search(-1, 10**18) // m)


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