結果

問題 No.1808 Fullgold Alchemist
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2022-01-14 21:30:53
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 150 ms / 2,000 ms
コード長 344 bytes
コンパイル時間 899 ms
コンパイル使用メモリ 87,192 KB
実行使用メモリ 107,408 KB
最終ジャッジ日時 2023-08-12 17:44:55
合計ジャッジ時間 6,024 ms
ジャッジサーバーID
(参考情報)
judge14 / judge9
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,344 KB
testcase_01 AC 72 ms
71,380 KB
testcase_02 AC 72 ms
71,384 KB
testcase_03 AC 72 ms
71,172 KB
testcase_04 AC 74 ms
71,180 KB
testcase_05 AC 129 ms
103,716 KB
testcase_06 AC 122 ms
107,408 KB
testcase_07 AC 112 ms
106,560 KB
testcase_08 AC 150 ms
99,756 KB
testcase_09 AC 134 ms
99,732 KB
testcase_10 AC 127 ms
99,796 KB
testcase_11 AC 132 ms
100,432 KB
testcase_12 AC 115 ms
106,392 KB
testcase_13 AC 125 ms
106,604 KB
testcase_14 AC 123 ms
106,840 KB
testcase_15 AC 123 ms
106,732 KB
testcase_16 AC 78 ms
76,244 KB
testcase_17 AC 71 ms
71,204 KB
testcase_18 AC 83 ms
79,556 KB
testcase_19 AC 75 ms
76,296 KB
testcase_20 AC 88 ms
81,892 KB
testcase_21 AC 79 ms
76,740 KB
testcase_22 AC 71 ms
71,508 KB
testcase_23 AC 78 ms
76,444 KB
testcase_24 AC 78 ms
76,152 KB
testcase_25 AC 77 ms
76,356 KB
testcase_26 AC 84 ms
78,604 KB
testcase_27 AC 86 ms
80,436 KB
testcase_28 AC 129 ms
99,908 KB
testcase_29 AC 93 ms
84,732 KB
testcase_30 AC 90 ms
83,408 KB
testcase_31 AC 124 ms
101,676 KB
testcase_32 AC 103 ms
91,040 KB
testcase_33 AC 114 ms
98,336 KB
testcase_34 AC 130 ms
99,800 KB
testcase_35 AC 113 ms
95,652 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