結果

問題 No.1808 Fullgold Alchemist
ユーザー kohei2019kohei2019
提出日時 2023-06-15 00:01:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 105 ms / 2,000 ms
コード長 475 bytes
コンパイル時間 332 ms
コンパイル使用メモリ 82,180 KB
実行使用メモリ 102,400 KB
最終ジャッジ日時 2024-06-23 04:52:43
合計ジャッジ時間 5,003 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
52,096 KB
testcase_01 AC 37 ms
52,608 KB
testcase_02 AC 41 ms
52,352 KB
testcase_03 AC 41 ms
52,096 KB
testcase_04 AC 37 ms
51,968 KB
testcase_05 AC 71 ms
95,744 KB
testcase_06 AC 93 ms
102,400 KB
testcase_07 AC 89 ms
101,760 KB
testcase_08 AC 105 ms
102,016 KB
testcase_09 AC 101 ms
101,888 KB
testcase_10 AC 98 ms
101,888 KB
testcase_11 AC 99 ms
102,144 KB
testcase_12 AC 85 ms
100,772 KB
testcase_13 AC 88 ms
101,760 KB
testcase_14 AC 87 ms
101,760 KB
testcase_15 AC 88 ms
102,016 KB
testcase_16 AC 43 ms
59,648 KB
testcase_17 AC 37 ms
52,480 KB
testcase_18 AC 48 ms
65,792 KB
testcase_19 AC 41 ms
59,428 KB
testcase_20 AC 52 ms
68,608 KB
testcase_21 AC 44 ms
62,080 KB
testcase_22 AC 36 ms
52,096 KB
testcase_23 AC 44 ms
61,312 KB
testcase_24 AC 43 ms
59,264 KB
testcase_25 AC 42 ms
59,904 KB
testcase_26 AC 47 ms
65,152 KB
testcase_27 AC 49 ms
67,456 KB
testcase_28 AC 88 ms
102,272 KB
testcase_29 AC 56 ms
73,472 KB
testcase_30 AC 64 ms
71,936 KB
testcase_31 AC 86 ms
97,664 KB
testcase_32 AC 68 ms
82,432 KB
testcase_33 AC 78 ms
92,160 KB
testcase_34 AC 94 ms
101,896 KB
testcase_35 AC 74 ms
88,576 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