結果

問題 No.2227 King Kraken's Attack
ユーザー lloyzlloyz
提出日時 2023-06-17 22:52:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 826 ms / 2,000 ms
コード長 451 bytes
コンパイル時間 671 ms
コンパイル使用メモリ 87,192 KB
実行使用メモリ 76,852 KB
最終ジャッジ日時 2023-09-07 18:25:14
合計ジャッジ時間 14,710 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,372 KB
testcase_01 AC 72 ms
71,260 KB
testcase_02 AC 72 ms
71,244 KB
testcase_03 AC 89 ms
76,052 KB
testcase_04 AC 69 ms
71,252 KB
testcase_05 AC 70 ms
71,324 KB
testcase_06 AC 86 ms
76,116 KB
testcase_07 AC 82 ms
76,192 KB
testcase_08 AC 83 ms
75,908 KB
testcase_09 AC 86 ms
75,912 KB
testcase_10 AC 79 ms
75,724 KB
testcase_11 AC 83 ms
76,180 KB
testcase_12 AC 86 ms
75,972 KB
testcase_13 AC 88 ms
76,192 KB
testcase_14 AC 341 ms
75,848 KB
testcase_15 AC 347 ms
75,960 KB
testcase_16 AC 267 ms
76,084 KB
testcase_17 AC 323 ms
76,160 KB
testcase_18 AC 90 ms
75,768 KB
testcase_19 AC 446 ms
75,832 KB
testcase_20 AC 387 ms
76,184 KB
testcase_21 AC 770 ms
76,056 KB
testcase_22 AC 471 ms
75,996 KB
testcase_23 AC 97 ms
76,116 KB
testcase_24 AC 250 ms
76,076 KB
testcase_25 AC 684 ms
76,044 KB
testcase_26 AC 322 ms
76,124 KB
testcase_27 AC 90 ms
76,036 KB
testcase_28 AC 821 ms
76,200 KB
testcase_29 AC 826 ms
75,968 KB
testcase_30 AC 769 ms
76,772 KB
testcase_31 AC 725 ms
76,268 KB
testcase_32 AC 400 ms
76,756 KB
testcase_33 AC 327 ms
76,732 KB
testcase_34 AC 275 ms
76,724 KB
testcase_35 AC 456 ms
76,852 KB
testcase_36 AC 391 ms
76,156 KB
testcase_37 AC 80 ms
75,988 KB
testcase_38 AC 80 ms
75,800 KB
testcase_39 AC 78 ms
75,872 KB
testcase_40 AC 79 ms
75,960 KB
testcase_41 AC 82 ms
75,856 KB
testcase_42 AC 76 ms
75,796 KB
testcase_43 AC 78 ms
75,840 KB
testcase_44 AC 82 ms
75,888 KB
testcase_45 AC 70 ms
71,636 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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

ans = 1 << 60
for x in range(h + w + 10):
    l, r = 0, h + w + 10
    if f(x, l) >= h * w:
        ans = min(ans, x)
    else:
        while r - l > 1:
            mid = (l + r) // 2
            if f(x, mid) >= h * w:
                r = mid
            else:
                l = mid
        ans = min(ans, x + r)
print(ans)
0