結果

問題 No.1808 Fullgold Alchemist
ユーザー kohei2019kohei2019
提出日時 2023-06-15 00:01:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 140 ms / 2,000 ms
コード長 475 bytes
コンパイル時間 1,973 ms
コンパイル使用メモリ 86,568 KB
実行使用メモリ 106,776 KB
最終ジャッジ日時 2023-09-05 08:58:44
合計ジャッジ時間 9,067 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,120 KB
testcase_01 AC 72 ms
71,112 KB
testcase_02 AC 72 ms
71,148 KB
testcase_03 AC 69 ms
71,164 KB
testcase_04 AC 70 ms
70,944 KB
testcase_05 AC 121 ms
103,452 KB
testcase_06 AC 140 ms
106,776 KB
testcase_07 AC 109 ms
106,156 KB
testcase_08 AC 130 ms
99,324 KB
testcase_09 AC 127 ms
99,600 KB
testcase_10 AC 124 ms
99,392 KB
testcase_11 AC 126 ms
100,536 KB
testcase_12 AC 114 ms
105,968 KB
testcase_13 AC 121 ms
106,168 KB
testcase_14 AC 118 ms
106,212 KB
testcase_15 AC 119 ms
106,204 KB
testcase_16 AC 74 ms
75,588 KB
testcase_17 AC 70 ms
71,432 KB
testcase_18 AC 78 ms
78,900 KB
testcase_19 AC 76 ms
75,740 KB
testcase_20 AC 82 ms
81,236 KB
testcase_21 AC 76 ms
76,128 KB
testcase_22 AC 68 ms
71,428 KB
testcase_23 AC 75 ms
75,656 KB
testcase_24 AC 73 ms
75,644 KB
testcase_25 AC 75 ms
75,652 KB
testcase_26 AC 81 ms
78,016 KB
testcase_27 AC 84 ms
79,964 KB
testcase_28 AC 128 ms
99,880 KB
testcase_29 AC 90 ms
83,956 KB
testcase_30 AC 88 ms
82,780 KB
testcase_31 AC 114 ms
101,468 KB
testcase_32 AC 101 ms
90,536 KB
testcase_33 AC 109 ms
97,656 KB
testcase_34 AC 127 ms
99,676 KB
testcase_35 AC 104 ms
95,076 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int,input().split())
lsA = list(map(int,input().split()))
# 鉱石をならす
def is_ok(arg):
    rem = 0
    for i in range(N):
        if lsA[i]+rem>=M*arg:
            rem = lsA[i]+rem-M*arg
        else:
            return False
    return True
 
 
def meguru_bisect(ng, ok):
    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if is_ok(mid):
            ok = mid
        else:
            ng = mid
    return ok
print(meguru_bisect(10**18+1,0))
0