結果

問題 No.1808 Fullgold Alchemist
ユーザー brthyyjpbrthyyjp
提出日時 2022-01-14 21:33:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 139 ms / 2,000 ms
コード長 314 bytes
コンパイル時間 451 ms
コンパイル使用メモリ 87,132 KB
実行使用メモリ 106,856 KB
最終ジャッジ日時 2023-08-12 17:50:43
合計ジャッジ時間 5,423 ms
ジャッジサーバーID
(参考情報)
judge13 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
70,940 KB
testcase_01 AC 74 ms
71,316 KB
testcase_02 AC 72 ms
71,008 KB
testcase_03 AC 72 ms
71,136 KB
testcase_04 AC 72 ms
71,276 KB
testcase_05 AC 127 ms
103,504 KB
testcase_06 AC 115 ms
106,856 KB
testcase_07 AC 108 ms
106,308 KB
testcase_08 AC 139 ms
99,096 KB
testcase_09 AC 130 ms
99,324 KB
testcase_10 AC 123 ms
99,524 KB
testcase_11 AC 125 ms
100,440 KB
testcase_12 AC 111 ms
106,012 KB
testcase_13 AC 119 ms
106,452 KB
testcase_14 AC 119 ms
106,324 KB
testcase_15 AC 115 ms
106,384 KB
testcase_16 AC 78 ms
75,804 KB
testcase_17 AC 71 ms
71,260 KB
testcase_18 AC 83 ms
79,020 KB
testcase_19 AC 76 ms
75,736 KB
testcase_20 AC 85 ms
81,360 KB
testcase_21 AC 77 ms
76,452 KB
testcase_22 AC 71 ms
71,156 KB
testcase_23 AC 78 ms
76,032 KB
testcase_24 AC 77 ms
75,860 KB
testcase_25 AC 76 ms
75,872 KB
testcase_26 AC 80 ms
78,064 KB
testcase_27 AC 88 ms
80,124 KB
testcase_28 AC 124 ms
99,780 KB
testcase_29 AC 88 ms
84,244 KB
testcase_30 AC 87 ms
82,860 KB
testcase_31 AC 117 ms
101,424 KB
testcase_32 AC 96 ms
90,560 KB
testcase_33 AC 110 ms
97,796 KB
testcase_34 AC 123 ms
99,700 KB
testcase_35 AC 105 ms
95,484 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