結果

問題 No.1808 Fullgold Alchemist
ユーザー ShirotsumeShirotsume
提出日時 2022-01-14 22:20:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 217 ms / 2,000 ms
コード長 417 bytes
コンパイル時間 388 ms
コンパイル使用メモリ 87,184 KB
実行使用メモリ 146,704 KB
最終ジャッジ日時 2023-08-12 20:27:32
合計ジャッジ時間 7,307 ms
ジャッジサーバーID
(参考情報)
judge10 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
71,548 KB
testcase_01 AC 87 ms
71,620 KB
testcase_02 AC 86 ms
71,552 KB
testcase_03 AC 87 ms
71,400 KB
testcase_04 AC 88 ms
71,712 KB
testcase_05 AC 167 ms
123,592 KB
testcase_06 AC 181 ms
127,324 KB
testcase_07 AC 163 ms
125,636 KB
testcase_08 AC 217 ms
146,032 KB
testcase_09 AC 194 ms
146,448 KB
testcase_10 AC 186 ms
146,588 KB
testcase_11 AC 185 ms
146,704 KB
testcase_12 AC 170 ms
125,140 KB
testcase_13 AC 179 ms
127,184 KB
testcase_14 AC 181 ms
127,428 KB
testcase_15 AC 178 ms
125,640 KB
testcase_16 AC 96 ms
76,240 KB
testcase_17 AC 88 ms
71,620 KB
testcase_18 AC 109 ms
86,408 KB
testcase_19 AC 95 ms
76,188 KB
testcase_20 AC 112 ms
88,340 KB
testcase_21 AC 100 ms
80,672 KB
testcase_22 AC 88 ms
71,652 KB
testcase_23 AC 98 ms
76,812 KB
testcase_24 AC 96 ms
76,484 KB
testcase_25 AC 102 ms
76,336 KB
testcase_26 AC 107 ms
82,732 KB
testcase_27 AC 111 ms
86,400 KB
testcase_28 AC 181 ms
140,364 KB
testcase_29 AC 123 ms
92,176 KB
testcase_30 AC 116 ms
90,112 KB
testcase_31 AC 168 ms
117,764 KB
testcase_32 AC 137 ms
103,060 KB
testcase_33 AC 158 ms
110,476 KB
testcase_34 AC 180 ms
139,796 KB
testcase_35 AC 151 ms
108,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int,input().split())
a = list(map(int,input().split()))
import copy
def check(x, a):
    for i in range(n):
        if a[i] < m * x:
            return False
        elif i < n - 1:
            a[i + 1] += a[i] - m * x
    return True

ok = 0
ng = 10 ** 9 + 3

while abs(ok - ng) > 1:
    A = copy.copy(a)
    mid = (ok + ng) // 2
    if check(mid, A):
        ok = mid
    else:
        ng = mid
print(ok)
0