結果

問題 No.1808 Fullgold Alchemist
ユーザー horitaka1999horitaka1999
提出日時 2022-01-15 10:09:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 102 ms / 2,000 ms
コード長 325 bytes
コンパイル時間 219 ms
コンパイル使用メモリ 82,472 KB
実行使用メモリ 104,396 KB
最終ジャッジ日時 2024-05-01 06:15:21
合計ジャッジ時間 3,805 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,960 KB
testcase_01 AC 34 ms
53,328 KB
testcase_02 AC 34 ms
53,292 KB
testcase_03 AC 34 ms
54,024 KB
testcase_04 AC 34 ms
53,108 KB
testcase_05 AC 65 ms
97,680 KB
testcase_06 AC 75 ms
104,396 KB
testcase_07 AC 69 ms
103,508 KB
testcase_08 AC 102 ms
102,152 KB
testcase_09 AC 87 ms
102,496 KB
testcase_10 AC 83 ms
102,432 KB
testcase_11 AC 90 ms
102,184 KB
testcase_12 AC 74 ms
102,708 KB
testcase_13 AC 79 ms
102,428 KB
testcase_14 AC 81 ms
103,272 KB
testcase_15 AC 78 ms
102,416 KB
testcase_16 AC 39 ms
60,788 KB
testcase_17 AC 33 ms
53,640 KB
testcase_18 AC 42 ms
67,188 KB
testcase_19 AC 37 ms
59,848 KB
testcase_20 AC 47 ms
69,656 KB
testcase_21 AC 40 ms
62,816 KB
testcase_22 AC 34 ms
53,096 KB
testcase_23 AC 40 ms
62,472 KB
testcase_24 AC 37 ms
60,240 KB
testcase_25 AC 38 ms
60,652 KB
testcase_26 AC 43 ms
66,444 KB
testcase_27 AC 47 ms
69,452 KB
testcase_28 AC 81 ms
102,728 KB
testcase_29 AC 51 ms
73,872 KB
testcase_30 AC 48 ms
72,364 KB
testcase_31 AC 76 ms
98,676 KB
testcase_32 AC 60 ms
84,716 KB
testcase_33 AC 73 ms
93,680 KB
testcase_34 AC 81 ms
102,260 KB
testcase_35 AC 69 ms
89,456 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