結果

問題 No.1808 Fullgold Alchemist
ユーザー NatsubiSoganNatsubiSogan
提出日時 2022-01-14 22:14:33
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 375 bytes
コンパイル時間 100 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 32,688 KB
最終ジャッジ日時 2024-04-30 15:17:13
合計ジャッジ時間 15,323 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,752 KB
testcase_01 AC 30 ms
10,752 KB
testcase_02 AC 33 ms
10,880 KB
testcase_03 AC 32 ms
10,752 KB
testcase_04 AC 30 ms
10,752 KB
testcase_05 AC 120 ms
14,728 KB
testcase_06 AC 550 ms
23,200 KB
testcase_07 AC 148 ms
23,200 KB
testcase_08 TLE -
testcase_09 AC 449 ms
32,672 KB
testcase_10 AC 228 ms
32,672 KB
testcase_11 AC 462 ms
32,620 KB
testcase_12 AC 160 ms
28,544 KB
testcase_13 AC 613 ms
28,668 KB
testcase_14 AC 556 ms
28,552 KB
testcase_15 AC 647 ms
28,544 KB
testcase_16 AC 49 ms
11,136 KB
testcase_17 AC 31 ms
10,752 KB
testcase_18 AC 126 ms
13,336 KB
testcase_19 AC 35 ms
10,880 KB
testcase_20 AC 212 ms
14,844 KB
testcase_21 AC 63 ms
12,376 KB
testcase_22 AC 31 ms
10,752 KB
testcase_23 AC 42 ms
11,776 KB
testcase_24 AC 54 ms
11,264 KB
testcase_25 AC 47 ms
11,264 KB
testcase_26 AC 204 ms
13,736 KB
testcase_27 AC 279 ms
14,860 KB
testcase_28 AC 973 ms
30,840 KB
testcase_29 AC 326 ms
17,308 KB
testcase_30 AC 246 ms
16,580 KB
testcase_31 AC 1,212 ms
29,532 KB
testcase_32 AC 502 ms
21,652 KB
testcase_33 AC 1,250 ms
26,320 KB
testcase_34 AC 842 ms
31,260 KB
testcase_35 AC 869 ms
24,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
a = list(map(int, input().split()))
l, r = -1, 10 ** 9 + 1
while r - l > 1:
    mid = (l + r) // 2
    amari = 0
    for i in a:
        if i >= mid * m:
            amari += i - mid * m
        else:
            if amari < mid * m - i:
                r = mid
                break
            amari -= mid * m - i
    else: l = mid
print(l)
0