結果

問題 No.1808 Fullgold Alchemist
ユーザー ShirotsumeShirotsume
提出日時 2022-01-14 22:20:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 161 ms / 2,000 ms
コード長 417 bytes
コンパイル時間 157 ms
コンパイル使用メモリ 82,532 KB
実行使用メモリ 152,100 KB
最終ジャッジ日時 2024-04-30 15:32:57
合計ジャッジ時間 4,730 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
54,096 KB
testcase_01 AC 42 ms
54,624 KB
testcase_02 AC 41 ms
54,872 KB
testcase_03 AC 44 ms
54,524 KB
testcase_04 AC 42 ms
54,012 KB
testcase_05 AC 108 ms
143,480 KB
testcase_06 AC 123 ms
152,100 KB
testcase_07 AC 115 ms
149,744 KB
testcase_08 AC 161 ms
145,864 KB
testcase_09 AC 139 ms
145,864 KB
testcase_10 AC 135 ms
145,740 KB
testcase_11 AC 139 ms
145,888 KB
testcase_12 AC 117 ms
147,856 KB
testcase_13 AC 129 ms
150,924 KB
testcase_14 AC 131 ms
150,828 KB
testcase_15 AC 125 ms
149,432 KB
testcase_16 AC 50 ms
63,456 KB
testcase_17 AC 42 ms
53,528 KB
testcase_18 AC 60 ms
76,424 KB
testcase_19 AC 49 ms
63,072 KB
testcase_20 AC 68 ms
82,612 KB
testcase_21 AC 56 ms
69,756 KB
testcase_22 AC 41 ms
54,128 KB
testcase_23 AC 51 ms
67,908 KB
testcase_24 AC 53 ms
64,048 KB
testcase_25 AC 50 ms
64,048 KB
testcase_26 AC 60 ms
74,108 KB
testcase_27 AC 66 ms
79,256 KB
testcase_28 AC 127 ms
122,388 KB
testcase_29 AC 73 ms
90,844 KB
testcase_30 AC 71 ms
87,012 KB
testcase_31 AC 126 ms
112,620 KB
testcase_32 AC 90 ms
109,488 KB
testcase_33 AC 112 ms
126,576 KB
testcase_34 AC 125 ms
121,876 KB
testcase_35 AC 105 ms
120,808 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