結果

問題 No.1808 Fullgold Alchemist
ユーザー ああいいああいい
提出日時 2022-01-14 21:39:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 140 ms / 2,000 ms
コード長 393 bytes
コンパイル時間 903 ms
コンパイル使用メモリ 87,196 KB
実行使用メモリ 107,196 KB
最終ジャッジ日時 2023-08-12 18:22:58
合計ジャッジ時間 5,612 ms
ジャッジサーバーID
(参考情報)
judge9 / judge2
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,536 KB
testcase_01 AC 70 ms
71,212 KB
testcase_02 AC 70 ms
71,380 KB
testcase_03 AC 70 ms
71,404 KB
testcase_04 AC 69 ms
71,076 KB
testcase_05 AC 103 ms
103,696 KB
testcase_06 AC 116 ms
107,196 KB
testcase_07 AC 109 ms
106,484 KB
testcase_08 AC 140 ms
99,556 KB
testcase_09 AC 126 ms
99,564 KB
testcase_10 AC 123 ms
99,632 KB
testcase_11 AC 127 ms
100,464 KB
testcase_12 AC 114 ms
106,052 KB
testcase_13 AC 119 ms
106,652 KB
testcase_14 AC 119 ms
106,652 KB
testcase_15 AC 118 ms
106,572 KB
testcase_16 AC 76 ms
76,360 KB
testcase_17 AC 69 ms
71,084 KB
testcase_18 AC 80 ms
79,348 KB
testcase_19 AC 76 ms
75,928 KB
testcase_20 AC 85 ms
81,728 KB
testcase_21 AC 77 ms
76,488 KB
testcase_22 AC 70 ms
71,540 KB
testcase_23 AC 77 ms
76,312 KB
testcase_24 AC 76 ms
76,116 KB
testcase_25 AC 75 ms
76,236 KB
testcase_26 AC 80 ms
78,528 KB
testcase_27 AC 83 ms
80,440 KB
testcase_28 AC 124 ms
99,924 KB
testcase_29 AC 89 ms
84,372 KB
testcase_30 AC 86 ms
83,008 KB
testcase_31 AC 117 ms
101,732 KB
testcase_32 AC 97 ms
90,924 KB
testcase_33 AC 111 ms
97,960 KB
testcase_34 AC 123 ms
99,860 KB
testcase_35 AC 105 ms
95,636 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

def check(L):
    stack = 0
    for a in A:
        if stack + a < L * M:
            return False
        else:
            stack = stack + a - L * M
    return True
end = 10 ** 9 + 1
start = 0
while end - start > 1:
    mid = (start + end) // 2
    if check(mid):
        start = mid
    else:
        end = mid
print(start)
0