結果

問題 No.1808 Fullgold Alchemist
ユーザー brthyyjpbrthyyjp
提出日時 2022-01-14 21:33:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 119 ms / 2,000 ms
コード長 314 bytes
コンパイル時間 302 ms
コンパイル使用メモリ 82,380 KB
実行使用メモリ 103,236 KB
最終ジャッジ日時 2024-04-30 12:57:58
合計ジャッジ時間 4,148 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
52,528 KB
testcase_01 AC 38 ms
52,092 KB
testcase_02 AC 40 ms
52,572 KB
testcase_03 AC 41 ms
53,352 KB
testcase_04 AC 40 ms
52,268 KB
testcase_05 AC 75 ms
96,732 KB
testcase_06 AC 86 ms
103,236 KB
testcase_07 AC 82 ms
102,124 KB
testcase_08 AC 119 ms
102,584 KB
testcase_09 AC 105 ms
102,016 KB
testcase_10 AC 102 ms
102,148 KB
testcase_11 AC 102 ms
102,188 KB
testcase_12 AC 85 ms
101,564 KB
testcase_13 AC 93 ms
102,660 KB
testcase_14 AC 91 ms
101,932 KB
testcase_15 AC 89 ms
102,816 KB
testcase_16 AC 44 ms
60,996 KB
testcase_17 AC 38 ms
52,896 KB
testcase_18 AC 52 ms
67,448 KB
testcase_19 AC 43 ms
60,264 KB
testcase_20 AC 53 ms
68,920 KB
testcase_21 AC 47 ms
62,936 KB
testcase_22 AC 39 ms
52,244 KB
testcase_23 AC 46 ms
62,656 KB
testcase_24 AC 44 ms
61,692 KB
testcase_25 AC 44 ms
60,132 KB
testcase_26 AC 51 ms
67,012 KB
testcase_27 AC 52 ms
69,552 KB
testcase_28 AC 90 ms
102,724 KB
testcase_29 AC 59 ms
74,368 KB
testcase_30 AC 58 ms
73,276 KB
testcase_31 AC 90 ms
98,660 KB
testcase_32 AC 70 ms
84,144 KB
testcase_33 AC 81 ms
93,288 KB
testcase_34 AC 92 ms
102,272 KB
testcase_35 AC 78 ms
91,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

def is_ok(x):
    y = 0
    for a in A:
        y += a-m*x
        if y < 0:
            return False
    return True

ok = 0
ng = 10**9+50
while ok +1 < ng:
    c = (ok+ng)//2
    if is_ok(c):
        ok = c
    else:
        ng = c
print(ok)
0