結果

問題 No.2227 King Kraken's Attack
ユーザー Ricky_ponRicky_pon
提出日時 2023-06-13 22:44:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,732 ms / 2,000 ms
コード長 625 bytes
コンパイル時間 584 ms
コンパイル使用メモリ 87,036 KB
実行使用メモリ 77,100 KB
最終ジャッジ日時 2023-09-04 10:33:19
合計ジャッジ時間 26,929 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,220 KB
testcase_01 AC 76 ms
71,376 KB
testcase_02 AC 75 ms
71,280 KB
testcase_03 AC 96 ms
75,960 KB
testcase_04 AC 76 ms
71,252 KB
testcase_05 AC 76 ms
71,224 KB
testcase_06 AC 92 ms
76,008 KB
testcase_07 AC 88 ms
75,976 KB
testcase_08 AC 88 ms
75,956 KB
testcase_09 AC 94 ms
76,032 KB
testcase_10 AC 80 ms
75,768 KB
testcase_11 AC 86 ms
75,784 KB
testcase_12 AC 90 ms
75,984 KB
testcase_13 AC 91 ms
76,004 KB
testcase_14 AC 1,075 ms
76,612 KB
testcase_15 AC 541 ms
76,556 KB
testcase_16 AC 840 ms
76,480 KB
testcase_17 AC 659 ms
76,672 KB
testcase_18 AC 115 ms
75,744 KB
testcase_19 AC 1,644 ms
76,540 KB
testcase_20 AC 1,583 ms
76,588 KB
testcase_21 AC 1,553 ms
76,732 KB
testcase_22 AC 769 ms
76,452 KB
testcase_23 AC 121 ms
76,576 KB
testcase_24 AC 747 ms
76,640 KB
testcase_25 AC 1,316 ms
76,620 KB
testcase_26 AC 1,067 ms
76,600 KB
testcase_27 AC 122 ms
75,836 KB
testcase_28 AC 1,720 ms
76,656 KB
testcase_29 AC 1,732 ms
77,028 KB
testcase_30 AC 1,714 ms
76,608 KB
testcase_31 AC 1,423 ms
76,476 KB
testcase_32 AC 941 ms
77,100 KB
testcase_33 AC 674 ms
76,616 KB
testcase_34 AC 501 ms
76,588 KB
testcase_35 AC 814 ms
76,860 KB
testcase_36 AC 855 ms
76,408 KB
testcase_37 AC 85 ms
75,732 KB
testcase_38 AC 85 ms
75,700 KB
testcase_39 AC 84 ms
75,776 KB
testcase_40 AC 83 ms
75,904 KB
testcase_41 AC 90 ms
75,924 KB
testcase_42 AC 83 ms
75,772 KB
testcase_43 AC 85 ms
75,560 KB
testcase_44 AC 91 ms
75,804 KB
testcase_45 AC 79 ms
71,300 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

input = sys.stdin.readline


def main():
    h, w, la, lb, ka, kb = map(int, input().split())

    f = lambda x, y: min(h, x * la) * min(w, y * lb) + x * ka + y * kb

    ans = 10**9
    for x in range(h + w + 10):
        low, high = 0, h + w + 10
        if f(x, low) >= h * w:
            ans = min(ans, x)
        else:
            while high - low > 1:
                mid = (high + low) // 2
                if f(x, mid) >= h * w:
                    high = mid
                else:
                    low = mid
            ans = min(ans, x + high)

    print(ans)


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