結果

問題 No.1808 Fullgold Alchemist
ユーザー tamatotamato
提出日時 2022-01-14 21:27:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 114 ms / 2,000 ms
コード長 551 bytes
コンパイル時間 178 ms
コンパイル使用メモリ 82,636 KB
実行使用メモリ 102,628 KB
最終ジャッジ日時 2024-04-30 12:45:37
合計ジャッジ時間 3,788 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
52,696 KB
testcase_01 AC 40 ms
52,320 KB
testcase_02 AC 39 ms
52,832 KB
testcase_03 AC 38 ms
52,952 KB
testcase_04 AC 39 ms
52,652 KB
testcase_05 AC 71 ms
95,744 KB
testcase_06 AC 81 ms
102,628 KB
testcase_07 AC 76 ms
101,444 KB
testcase_08 AC 114 ms
100,468 KB
testcase_09 AC 97 ms
100,324 KB
testcase_10 AC 94 ms
100,440 KB
testcase_11 AC 95 ms
100,400 KB
testcase_12 AC 81 ms
100,660 KB
testcase_13 AC 87 ms
100,692 KB
testcase_14 AC 87 ms
102,016 KB
testcase_15 AC 85 ms
101,352 KB
testcase_16 AC 42 ms
59,616 KB
testcase_17 AC 39 ms
53,008 KB
testcase_18 AC 50 ms
65,948 KB
testcase_19 AC 42 ms
60,260 KB
testcase_20 AC 53 ms
69,640 KB
testcase_21 AC 45 ms
63,432 KB
testcase_22 AC 38 ms
52,676 KB
testcase_23 AC 43 ms
61,660 KB
testcase_24 AC 44 ms
60,328 KB
testcase_25 AC 42 ms
60,588 KB
testcase_26 AC 49 ms
65,504 KB
testcase_27 AC 53 ms
68,876 KB
testcase_28 AC 87 ms
100,768 KB
testcase_29 AC 56 ms
73,020 KB
testcase_30 AC 54 ms
71,184 KB
testcase_31 AC 83 ms
97,156 KB
testcase_32 AC 65 ms
81,968 KB
testcase_33 AC 79 ms
91,012 KB
testcase_34 AC 86 ms
100,468 KB
testcase_35 AC 75 ms
88,320 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

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

    ok = 0
    ng = 10 ** 9 + 1
    mid = (ok + ng) // 2
    while ng - ok > 1:
        x = 0
        flg = 1
        for a in A:
            x += a - M * mid
            if x < 0:
                flg = 0
                break
        if flg:
            ok = mid
        else:
            ng = mid
        mid = (ok + ng) // 2
    print(ok)


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