結果

問題 No.1808 Fullgold Alchemist
ユーザー rlangevinrlangevin
提出日時 2023-01-01 21:32:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 101 ms / 2,000 ms
コード長 405 bytes
コンパイル時間 133 ms
コンパイル使用メモリ 82,296 KB
実行使用メモリ 104,192 KB
最終ジャッジ日時 2024-05-05 05:57:15
合計ジャッジ時間 4,339 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
51,840 KB
testcase_01 AC 34 ms
52,096 KB
testcase_02 AC 34 ms
51,996 KB
testcase_03 AC 34 ms
51,968 KB
testcase_04 AC 35 ms
52,096 KB
testcase_05 AC 72 ms
95,872 KB
testcase_06 AC 78 ms
103,296 KB
testcase_07 AC 72 ms
101,760 KB
testcase_08 AC 101 ms
102,400 KB
testcase_09 AC 94 ms
102,144 KB
testcase_10 AC 90 ms
102,400 KB
testcase_11 AC 94 ms
102,120 KB
testcase_12 AC 77 ms
101,120 KB
testcase_13 AC 84 ms
102,272 KB
testcase_14 AC 81 ms
102,016 KB
testcase_15 AC 83 ms
102,272 KB
testcase_16 AC 41 ms
59,904 KB
testcase_17 AC 34 ms
52,096 KB
testcase_18 AC 45 ms
66,176 KB
testcase_19 AC 40 ms
59,684 KB
testcase_20 AC 49 ms
69,248 KB
testcase_21 AC 41 ms
62,464 KB
testcase_22 AC 34 ms
51,840 KB
testcase_23 AC 40 ms
61,184 KB
testcase_24 AC 40 ms
59,904 KB
testcase_25 AC 41 ms
60,800 KB
testcase_26 AC 45 ms
65,928 KB
testcase_27 AC 49 ms
67,968 KB
testcase_28 AC 87 ms
104,192 KB
testcase_29 AC 53 ms
73,472 KB
testcase_30 AC 52 ms
71,936 KB
testcase_31 AC 79 ms
97,920 KB
testcase_32 AC 68 ms
82,944 KB
testcase_33 AC 77 ms
92,544 KB
testcase_34 AC 88 ms
102,508 KB
testcase_35 AC 69 ms
89,216 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def check(m):
    cnt = 0
    for i in range(N):
        if m * M > A[i] + cnt:
            return False
        cnt += A[i] - m * M
        if cnt < 0:
            return False
    return True

N, M = map(int, input().split())
A = list(map(int, input().split()))
yes = 0
no = 10 ** 18
while no - yes != 1:
    mid = (yes + no)//2
    if check(mid):
        yes = mid
    else:
        no = mid
print(yes)
0