結果

問題 No.1808 Fullgold Alchemist
ユーザー ygd.ygd.
提出日時 2022-01-14 21:46:19
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 107 ms / 2,000 ms
コード長 912 bytes
コンパイル時間 219 ms
コンパイル使用メモリ 82,160 KB
実行使用メモリ 104,232 KB
最終ジャッジ日時 2024-04-30 13:58:32
合計ジャッジ時間 3,701 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
54,792 KB
testcase_01 AC 39 ms
54,436 KB
testcase_02 AC 36 ms
53,960 KB
testcase_03 AC 36 ms
54,368 KB
testcase_04 AC 35 ms
54,268 KB
testcase_05 AC 73 ms
98,276 KB
testcase_06 AC 78 ms
104,232 KB
testcase_07 AC 77 ms
103,952 KB
testcase_08 AC 107 ms
100,640 KB
testcase_09 AC 98 ms
101,156 KB
testcase_10 AC 93 ms
100,892 KB
testcase_11 AC 94 ms
99,792 KB
testcase_12 AC 78 ms
103,772 KB
testcase_13 AC 85 ms
103,832 KB
testcase_14 AC 86 ms
103,616 KB
testcase_15 AC 88 ms
103,628 KB
testcase_16 AC 42 ms
61,444 KB
testcase_17 AC 41 ms
54,400 KB
testcase_18 AC 47 ms
67,280 KB
testcase_19 AC 42 ms
61,416 KB
testcase_20 AC 52 ms
70,372 KB
testcase_21 AC 45 ms
64,712 KB
testcase_22 AC 37 ms
53,812 KB
testcase_23 AC 43 ms
64,512 KB
testcase_24 AC 40 ms
61,932 KB
testcase_25 AC 41 ms
61,656 KB
testcase_26 AC 46 ms
68,064 KB
testcase_27 AC 50 ms
70,152 KB
testcase_28 AC 92 ms
99,332 KB
testcase_29 AC 53 ms
75,752 KB
testcase_30 AC 52 ms
74,068 KB
testcase_31 AC 84 ms
98,864 KB
testcase_32 AC 64 ms
84,636 KB
testcase_33 AC 75 ms
94,564 KB
testcase_34 AC 91 ms
99,268 KB
testcase_35 AC 70 ms
91,168 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
#input = sys.stdin.readline #文字列につけてはダメ
#input = sys.stdin.buffer.readline #文字列につけてはダメ
#sys.setrecursionlimit(1000000)
#import bisect
#import itertools
#import random
#from heapq import heapify, heappop, heappush
from collections import defaultdict 
#from collections import deque
#import copy
#import math
#from functools import lru_cache
#MOD = pow(10,9) + 7
#MOD = 998244353


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

    def check(x):
        amari = 0
        for a in A:
            if a + amari < x*M:
                return False
            amari = (a + amari - x*M)
        return True

    ok = 0
    ng = pow(10,9) + 100
    while abs(ok-ng) > 1:
        mid = (ok+ng)//2
        if check(mid):
            ok = mid
        else:
            ng = mid
    print(ok)

if __name__ == '__main__':
    main()
0