結果

問題 No.2227 King Kraken's Attack
ユーザー ああいいああいい
提出日時 2023-02-26 10:47:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 429 ms / 2,000 ms
コード長 483 bytes
コンパイル時間 321 ms
コンパイル使用メモリ 82,408 KB
実行使用メモリ 75,508 KB
最終ジャッジ日時 2024-04-10 09:46:51
合計ジャッジ時間 7,725 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
52,532 KB
testcase_01 AC 32 ms
52,312 KB
testcase_02 AC 32 ms
52,740 KB
testcase_03 AC 47 ms
65,436 KB
testcase_04 AC 34 ms
52,572 KB
testcase_05 AC 32 ms
52,328 KB
testcase_06 AC 33 ms
53,044 KB
testcase_07 AC 34 ms
53,456 KB
testcase_08 AC 50 ms
64,260 KB
testcase_09 AC 48 ms
62,712 KB
testcase_10 AC 44 ms
60,468 KB
testcase_11 AC 43 ms
61,772 KB
testcase_12 AC 46 ms
62,780 KB
testcase_13 AC 50 ms
63,372 KB
testcase_14 AC 44 ms
58,820 KB
testcase_15 AC 43 ms
59,016 KB
testcase_16 AC 224 ms
63,548 KB
testcase_17 AC 254 ms
63,164 KB
testcase_18 AC 164 ms
59,732 KB
testcase_19 AC 185 ms
63,412 KB
testcase_20 AC 221 ms
65,076 KB
testcase_21 AC 349 ms
72,912 KB
testcase_22 AC 285 ms
69,768 KB
testcase_23 AC 76 ms
69,448 KB
testcase_24 AC 57 ms
65,784 KB
testcase_25 AC 287 ms
61,228 KB
testcase_26 AC 40 ms
60,312 KB
testcase_27 AC 234 ms
66,512 KB
testcase_28 AC 429 ms
70,864 KB
testcase_29 AC 391 ms
72,436 KB
testcase_30 AC 246 ms
75,508 KB
testcase_31 AC 365 ms
69,516 KB
testcase_32 AC 88 ms
68,972 KB
testcase_33 AC 146 ms
71,788 KB
testcase_34 AC 158 ms
72,648 KB
testcase_35 AC 119 ms
72,564 KB
testcase_36 AC 275 ms
70,424 KB
testcase_37 AC 117 ms
63,120 KB
testcase_38 AC 78 ms
63,092 KB
testcase_39 AC 49 ms
61,972 KB
testcase_40 AC 80 ms
63,708 KB
testcase_41 AC 154 ms
63,124 KB
testcase_42 AC 83 ms
63,560 KB
testcase_43 AC 124 ms
61,920 KB
testcase_44 AC 262 ms
61,676 KB
testcase_45 AC 33 ms
52,408 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

H,W,LA,LB,KA,KB = map(int,input().split())

ans = 10 ** 8


def calc(w,h):
    a = w * KB + h * KA
    gyo = min(w * LB,W)
    retu = min(h * LA,H)
    return a + gyo * retu >= H * W
for w in range(W + 1):
    if not calc(w,H + W - w):
        continue
    end = H + W - w
    start = -1
    while end -start > 1:
        mid = end +start >> 1
        if calc(w,mid):
            end = mid
        else:
            start = mid
    if w + end < ans:
        ans = w + end
print(ans)
0