結果

問題 No.1808 Fullgold Alchemist
ユーザー ygd.ygd.
提出日時 2022-01-14 21:46:19
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 152 ms / 2,000 ms
コード長 912 bytes
コンパイル時間 288 ms
コンパイル使用メモリ 87,008 KB
実行使用メモリ 110,600 KB
最終ジャッジ日時 2023-08-12 18:52:50
合計ジャッジ時間 6,040 ms
ジャッジサーバーID
(参考情報)
judge12 / judge2
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
71,784 KB
testcase_01 AC 90 ms
71,564 KB
testcase_02 AC 90 ms
71,644 KB
testcase_03 AC 92 ms
71,340 KB
testcase_04 AC 93 ms
71,516 KB
testcase_05 AC 125 ms
104,928 KB
testcase_06 AC 132 ms
107,964 KB
testcase_07 AC 128 ms
107,468 KB
testcase_08 AC 152 ms
110,600 KB
testcase_09 AC 138 ms
110,512 KB
testcase_10 AC 137 ms
110,504 KB
testcase_11 AC 137 ms
110,000 KB
testcase_12 AC 135 ms
107,236 KB
testcase_13 AC 137 ms
107,816 KB
testcase_14 AC 139 ms
107,420 KB
testcase_15 AC 136 ms
107,708 KB
testcase_16 AC 93 ms
77,308 KB
testcase_17 AC 86 ms
71,768 KB
testcase_18 AC 100 ms
80,080 KB
testcase_19 AC 96 ms
77,520 KB
testcase_20 AC 103 ms
82,044 KB
testcase_21 AC 97 ms
77,544 KB
testcase_22 AC 87 ms
71,772 KB
testcase_23 AC 93 ms
77,216 KB
testcase_24 AC 95 ms
77,268 KB
testcase_25 AC 94 ms
77,232 KB
testcase_26 AC 97 ms
79,012 KB
testcase_27 AC 104 ms
81,436 KB
testcase_28 AC 136 ms
106,020 KB
testcase_29 AC 107 ms
85,552 KB
testcase_30 AC 104 ms
84,380 KB
testcase_31 AC 134 ms
102,580 KB
testcase_32 AC 118 ms
92,064 KB
testcase_33 AC 130 ms
99,112 KB
testcase_34 AC 137 ms
106,012 KB
testcase_35 AC 124 ms
96,348 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