結果

問題 No.1808 Fullgold Alchemist
ユーザー rlangevinrlangevin
提出日時 2023-01-01 21:32:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 138 ms / 2,000 ms
コード長 405 bytes
コンパイル時間 279 ms
コンパイル使用メモリ 86,856 KB
実行使用メモリ 107,112 KB
最終ジャッジ日時 2023-08-17 23:10:37
合計ジャッジ時間 8,287 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,488 KB
testcase_01 AC 70 ms
71,472 KB
testcase_02 AC 71 ms
71,468 KB
testcase_03 AC 70 ms
71,520 KB
testcase_04 AC 72 ms
71,252 KB
testcase_05 AC 102 ms
103,940 KB
testcase_06 AC 116 ms
107,112 KB
testcase_07 AC 110 ms
106,448 KB
testcase_08 AC 138 ms
99,592 KB
testcase_09 AC 128 ms
99,316 KB
testcase_10 AC 125 ms
99,524 KB
testcase_11 AC 127 ms
100,588 KB
testcase_12 AC 112 ms
106,068 KB
testcase_13 AC 122 ms
106,552 KB
testcase_14 AC 120 ms
106,532 KB
testcase_15 AC 121 ms
106,344 KB
testcase_16 AC 79 ms
76,068 KB
testcase_17 AC 73 ms
71,240 KB
testcase_18 AC 82 ms
79,104 KB
testcase_19 AC 77 ms
75,976 KB
testcase_20 AC 87 ms
81,404 KB
testcase_21 AC 79 ms
76,548 KB
testcase_22 AC 72 ms
71,464 KB
testcase_23 AC 77 ms
75,928 KB
testcase_24 AC 78 ms
76,228 KB
testcase_25 AC 78 ms
75,992 KB
testcase_26 AC 84 ms
78,544 KB
testcase_27 AC 85 ms
80,324 KB
testcase_28 AC 129 ms
100,144 KB
testcase_29 AC 91 ms
84,572 KB
testcase_30 AC 88 ms
83,156 KB
testcase_31 AC 117 ms
101,604 KB
testcase_32 AC 101 ms
90,996 KB
testcase_33 AC 112 ms
98,240 KB
testcase_34 AC 130 ms
99,688 KB
testcase_35 AC 106 ms
95,528 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def check(m):
    cnt = 0
    for i in range(N):
        if m * M > A[i] + cnt:
            return False
        cnt += A[i] - m * M
        if cnt < 0:
            return False
    return True

N, M = map(int, input().split())
A = list(map(int, input().split()))
yes = 0
no = 10 ** 18
while no - yes != 1:
    mid = (yes + no)//2
    if check(mid):
        yes = mid
    else:
        no = mid
print(yes)
0