結果

問題 No.1808 Fullgold Alchemist
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2022-01-14 21:30:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 344 bytes
コンパイル時間 166 ms
コンパイル使用メモリ 82,372 KB
実行使用メモリ 104,888 KB
最終ジャッジ日時 2024-04-30 12:52:30
合計ジャッジ時間 4,081 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
52,392 KB
testcase_01 AC 38 ms
52,768 KB
testcase_02 AC 39 ms
53,036 KB
testcase_03 AC 41 ms
53,212 KB
testcase_04 AC 40 ms
52,448 KB
testcase_05 AC 75 ms
96,756 KB
testcase_06 AC 89 ms
103,896 KB
testcase_07 AC 82 ms
103,156 KB
testcase_08 AC 127 ms
102,204 KB
testcase_09 AC 105 ms
102,272 KB
testcase_10 AC 105 ms
102,292 KB
testcase_11 AC 105 ms
102,172 KB
testcase_12 AC 85 ms
101,568 KB
testcase_13 AC 95 ms
103,708 KB
testcase_14 AC 95 ms
104,888 KB
testcase_15 AC 93 ms
103,532 KB
testcase_16 AC 47 ms
61,372 KB
testcase_17 AC 38 ms
53,272 KB
testcase_18 AC 52 ms
68,236 KB
testcase_19 AC 45 ms
60,884 KB
testcase_20 AC 58 ms
70,068 KB
testcase_21 AC 49 ms
63,632 KB
testcase_22 AC 37 ms
53,812 KB
testcase_23 AC 47 ms
64,408 KB
testcase_24 AC 46 ms
62,236 KB
testcase_25 AC 46 ms
63,128 KB
testcase_26 AC 52 ms
66,808 KB
testcase_27 AC 57 ms
69,020 KB
testcase_28 AC 98 ms
104,368 KB
testcase_29 AC 63 ms
75,188 KB
testcase_30 AC 59 ms
74,140 KB
testcase_31 AC 92 ms
98,984 KB
testcase_32 AC 72 ms
84,516 KB
testcase_33 AC 88 ms
93,580 KB
testcase_34 AC 101 ms
104,328 KB
testcase_35 AC 89 ms
91,708 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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

l = 0
r = max(A)+1

while r-l != 1:

    m = (l+r)//2

    now = 0
    flag = True

    for i in range(N):
        now += A[i]
        now -= M * m

        if now < 0:
            flag = False
            break

    if flag:
        l = m
    else:
        r = m

print (l)
0