結果

問題 No.2227 King Kraken's Attack
ユーザー rlangevinrlangevin
提出日時 2023-10-11 13:35:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 488 ms / 2,000 ms
コード長 549 bytes
コンパイル時間 1,291 ms
コンパイル使用メモリ 86,688 KB
実行使用メモリ 77,148 KB
最終ジャッジ日時 2023-10-11 13:35:55
合計ジャッジ時間 10,795 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,256 KB
testcase_01 AC 72 ms
71,524 KB
testcase_02 AC 70 ms
71,188 KB
testcase_03 AC 94 ms
75,744 KB
testcase_04 AC 74 ms
71,448 KB
testcase_05 AC 75 ms
71,396 KB
testcase_06 AC 76 ms
71,232 KB
testcase_07 AC 86 ms
75,992 KB
testcase_08 AC 77 ms
71,240 KB
testcase_09 AC 87 ms
75,860 KB
testcase_10 AC 103 ms
75,420 KB
testcase_11 AC 86 ms
76,028 KB
testcase_12 AC 88 ms
76,048 KB
testcase_13 AC 96 ms
75,808 KB
testcase_14 AC 81 ms
75,828 KB
testcase_15 AC 371 ms
75,880 KB
testcase_16 AC 84 ms
75,724 KB
testcase_17 AC 358 ms
76,028 KB
testcase_18 AC 89 ms
75,776 KB
testcase_19 AC 225 ms
75,768 KB
testcase_20 AC 234 ms
76,040 KB
testcase_21 AC 364 ms
76,828 KB
testcase_22 AC 481 ms
75,956 KB
testcase_23 AC 107 ms
76,080 KB
testcase_24 AC 204 ms
76,152 KB
testcase_25 AC 173 ms
75,740 KB
testcase_26 AC 80 ms
75,772 KB
testcase_27 AC 92 ms
75,840 KB
testcase_28 AC 466 ms
76,928 KB
testcase_29 AC 415 ms
76,444 KB
testcase_30 AC 488 ms
76,732 KB
testcase_31 AC 450 ms
77,148 KB
testcase_32 AC 417 ms
76,712 KB
testcase_33 AC 303 ms
76,688 KB
testcase_34 AC 215 ms
76,164 KB
testcase_35 AC 420 ms
77,044 KB
testcase_36 AC 302 ms
75,860 KB
testcase_37 AC 83 ms
75,976 KB
testcase_38 AC 80 ms
75,960 KB
testcase_39 AC 80 ms
75,960 KB
testcase_40 AC 80 ms
75,956 KB
testcase_41 AC 83 ms
75,976 KB
testcase_42 AC 81 ms
75,748 KB
testcase_43 AC 83 ms
75,960 KB
testcase_44 AC 86 ms
75,976 KB
testcase_45 AC 73 ms
71,584 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def check(h, w):
    yoko = min(H, h * LA)
    tate = min(W, w * LB)
    nokori = H * W - yoko * tate
    return h * KA + w * KB - nokori >= 0 

H, W, LA, LB, KA, KB = map(int, input().split())
ans = 10 ** 18
for h in range(max(H, W) + 1):
    yes = 10 ** 6
    if not check(h, yes):
        continue
    if check(h, 0):
        ans = min(ans, h)
        continue
    no = 0
    while yes - no != 1:
        mid = (yes + no)//2
        if check(h, mid):
            yes = mid
        else:
            no = mid
    ans = min(ans, h + yes)
print(ans)
0