結果

問題 No.1808 Fullgold Alchemist
ユーザー titiatitia
提出日時 2022-01-14 21:34:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 362 bytes
コンパイル時間 92 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 32,796 KB
最終ジャッジ日時 2024-04-30 13:02:52
合計ジャッジ時間 13,285 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,624 KB
testcase_01 AC 31 ms
10,752 KB
testcase_02 AC 30 ms
10,624 KB
testcase_03 AC 30 ms
10,624 KB
testcase_04 AC 32 ms
10,624 KB
testcase_05 AC 76 ms
14,756 KB
testcase_06 AC 400 ms
23,068 KB
testcase_07 AC 92 ms
23,068 KB
testcase_08 TLE -
testcase_09 AC 453 ms
32,544 KB
testcase_10 AC 169 ms
32,540 KB
testcase_11 AC 452 ms
32,536 KB
testcase_12 AC 106 ms
27,440 KB
testcase_13 AC 604 ms
27,392 KB
testcase_14 AC 511 ms
27,404 KB
testcase_15 AC 484 ms
27,364 KB
testcase_16 AC 45 ms
11,136 KB
testcase_17 AC 30 ms
10,624 KB
testcase_18 AC 100 ms
13,184 KB
testcase_19 AC 35 ms
10,752 KB
testcase_20 AC 159 ms
14,716 KB
testcase_21 AC 57 ms
12,160 KB
testcase_22 AC 30 ms
10,752 KB
testcase_23 AC 49 ms
11,648 KB
testcase_24 AC 46 ms
11,008 KB
testcase_25 AC 40 ms
11,136 KB
testcase_26 AC 206 ms
13,600 KB
testcase_27 AC 253 ms
14,732 KB
testcase_28 AC 696 ms
30,712 KB
testcase_29 AC 277 ms
17,184 KB
testcase_30 AC 215 ms
16,500 KB
testcase_31 AC 850 ms
29,276 KB
testcase_32 AC 429 ms
21,532 KB
testcase_33 AC 833 ms
26,320 KB
testcase_34 AC 754 ms
31,132 KB
testcase_35 AC 791 ms
24,256 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N,M=map(int,input().split())
A=list(map(int,input().split()))

OK=0
NG=max(A)+1

while NG>OK+1:
    mid=(OK+NG)//2

    now=0
    for a in A:
        now+=a
        now-=mid*M

        if now<0:
            NG=mid
            break
    else:
        if now<0:
            NG=mid
        else:
            OK=mid

print(OK)
0