結果

問題 No.1808 Fullgold Alchemist
ユーザー gr1msl3ygr1msl3y
提出日時 2022-01-14 23:05:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 331 bytes
コンパイル時間 265 ms
コンパイル使用メモリ 82,404 KB
実行使用メモリ 103,768 KB
最終ジャッジ日時 2024-04-30 16:55:03
合計ジャッジ時間 4,260 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
52,524 KB
testcase_01 AC 41 ms
52,196 KB
testcase_02 AC 41 ms
52,344 KB
testcase_03 AC 41 ms
53,188 KB
testcase_04 AC 41 ms
53,264 KB
testcase_05 AC 79 ms
96,728 KB
testcase_06 AC 95 ms
103,768 KB
testcase_07 AC 87 ms
103,256 KB
testcase_08 AC 126 ms
102,124 KB
testcase_09 AC 112 ms
102,024 KB
testcase_10 AC 108 ms
102,320 KB
testcase_11 AC 111 ms
102,408 KB
testcase_12 AC 95 ms
101,024 KB
testcase_13 AC 100 ms
103,592 KB
testcase_14 AC 98 ms
102,780 KB
testcase_15 AC 98 ms
102,248 KB
testcase_16 AC 46 ms
60,916 KB
testcase_17 AC 40 ms
53,212 KB
testcase_18 AC 52 ms
66,656 KB
testcase_19 AC 45 ms
59,228 KB
testcase_20 AC 58 ms
70,312 KB
testcase_21 AC 50 ms
63,540 KB
testcase_22 AC 40 ms
52,328 KB
testcase_23 AC 48 ms
62,588 KB
testcase_24 AC 47 ms
61,168 KB
testcase_25 AC 48 ms
61,200 KB
testcase_26 AC 55 ms
65,644 KB
testcase_27 AC 57 ms
68,876 KB
testcase_28 AC 100 ms
102,788 KB
testcase_29 AC 64 ms
73,724 KB
testcase_30 AC 62 ms
71,980 KB
testcase_31 AC 96 ms
97,652 KB
testcase_32 AC 76 ms
83,340 KB
testcase_33 AC 93 ms
93,984 KB
testcase_34 AC 103 ms
102,268 KB
testcase_35 AC 84 ms
88,984 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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


def solve(k):
    ct = 0
    for a in A:
        ct += a-k*M
        if ct < 0:
            return False
    else:
        return True


ok, ng = 0, 10**9+1
while ng-ok > 1:
    m = (ng+ok)//2
    if solve(m):
        ok = m
    else:
        ng = m
print(ok)
0