結果

問題 No.1808 Fullgold Alchemist
ユーザー horitaka1999horitaka1999
提出日時 2022-01-15 10:09:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 143 ms / 2,000 ms
コード長 325 bytes
コンパイル時間 322 ms
コンパイル使用メモリ 87,252 KB
実行使用メモリ 107,292 KB
最終ジャッジ日時 2023-08-13 12:59:50
合計ジャッジ時間 5,907 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,304 KB
testcase_01 AC 72 ms
71,360 KB
testcase_02 AC 72 ms
71,368 KB
testcase_03 AC 78 ms
71,352 KB
testcase_04 AC 74 ms
71,276 KB
testcase_05 AC 107 ms
103,856 KB
testcase_06 AC 119 ms
107,292 KB
testcase_07 AC 110 ms
106,524 KB
testcase_08 AC 143 ms
99,672 KB
testcase_09 AC 129 ms
99,796 KB
testcase_10 AC 126 ms
99,488 KB
testcase_11 AC 130 ms
100,676 KB
testcase_12 AC 114 ms
106,172 KB
testcase_13 AC 123 ms
106,844 KB
testcase_14 AC 122 ms
106,804 KB
testcase_15 AC 122 ms
106,808 KB
testcase_16 AC 78 ms
76,504 KB
testcase_17 AC 74 ms
71,308 KB
testcase_18 AC 85 ms
79,484 KB
testcase_19 AC 78 ms
76,404 KB
testcase_20 AC 88 ms
81,716 KB
testcase_21 AC 82 ms
76,388 KB
testcase_22 AC 73 ms
71,280 KB
testcase_23 AC 80 ms
76,288 KB
testcase_24 AC 78 ms
76,280 KB
testcase_25 AC 78 ms
76,280 KB
testcase_26 AC 82 ms
78,572 KB
testcase_27 AC 86 ms
80,504 KB
testcase_28 AC 127 ms
99,992 KB
testcase_29 AC 92 ms
84,468 KB
testcase_30 AC 89 ms
83,368 KB
testcase_31 AC 121 ms
101,780 KB
testcase_32 AC 100 ms
91,104 KB
testcase_33 AC 111 ms
97,896 KB
testcase_34 AC 126 ms
100,168 KB
testcase_35 AC 109 ms
95,604 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int,input().split())
A = list(map(int,input().split()))
def is_ok(k):
    sgm = 0
    for a in A:
        sgm += a - M * k
        if sgm < 0:
            return False
    return True

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