結果

問題 No.2227 King Kraken's Attack
ユーザー titiatitia
提出日時 2023-03-01 06:51:55
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 700 bytes
コンパイル時間 367 ms
コンパイル使用メモリ 82,580 KB
実行使用メモリ 69,728 KB
最終ジャッジ日時 2024-04-10 09:50:01
合計ジャッジ時間 4,196 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
53,132 KB
testcase_01 AC 33 ms
52,332 KB
testcase_02 AC 32 ms
52,796 KB
testcase_03 AC 43 ms
62,800 KB
testcase_04 AC 34 ms
52,536 KB
testcase_05 AC 33 ms
52,244 KB
testcase_06 AC 41 ms
61,348 KB
testcase_07 AC 33 ms
52,476 KB
testcase_08 AC 41 ms
61,132 KB
testcase_09 AC 50 ms
62,576 KB
testcase_10 AC 35 ms
54,060 KB
testcase_11 AC 40 ms
60,592 KB
testcase_12 AC 38 ms
61,044 KB
testcase_13 AC 38 ms
60,164 KB
testcase_14 WA -
testcase_15 AC 35 ms
52,696 KB
testcase_16 AC 196 ms
60,792 KB
testcase_17 AC 233 ms
63,692 KB
testcase_18 AC 43 ms
59,680 KB
testcase_19 AC 41 ms
61,964 KB
testcase_20 AC 41 ms
60,868 KB
testcase_21 AC 78 ms
64,616 KB
testcase_22 AC 33 ms
52,804 KB
testcase_23 AC 34 ms
52,244 KB
testcase_24 AC 90 ms
61,560 KB
testcase_25 AC 140 ms
59,676 KB
testcase_26 WA -
testcase_27 AC 40 ms
58,652 KB
testcase_28 AC 59 ms
66,992 KB
testcase_29 AC 50 ms
64,072 KB
testcase_30 AC 51 ms
66,748 KB
testcase_31 AC 60 ms
65,452 KB
testcase_32 AC 48 ms
63,708 KB
testcase_33 AC 52 ms
64,776 KB
testcase_34 AC 49 ms
64,228 KB
testcase_35 AC 65 ms
69,728 KB
testcase_36 AC 45 ms
62,904 KB
testcase_37 AC 34 ms
53,220 KB
testcase_38 AC 34 ms
52,732 KB
testcase_39 AC 34 ms
52,268 KB
testcase_40 AC 35 ms
52,772 KB
testcase_41 AC 33 ms
52,460 KB
testcase_42 AC 33 ms
52,892 KB
testcase_43 AC 33 ms
52,436 KB
testcase_44 AC 33 ms
53,888 KB
testcase_45 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

ANS=10**9

for yoko in range((H+LA-1)//LA+1):
    teki=H*W
    
    yoko_damage=W*min(H,yoko*LA)
    no_damage=teki-yoko_damage

    if no_damage>=KA*yoko:
        no_damage-=KA*yoko
    else:
        yoko_damage-=KA*yoko-no_damage
        no_damage=0

    #print(yoko,yoko_damage,no_damage)

    if yoko_damage<=0 and no_damage<=0:
        ANS=min(ANS,yoko)
        continue

    NG=0
    OK=10**6+1

    while OK>NG+1:
        mid=(OK+NG)//2

        rest=max(0,yoko_damage-min(W,mid*LB)*min(H,yoko*LA))+no_damage

        if mid*KB>=rest:
            OK=mid
        else:
            NG=mid

    #print(yoko,OK)
    ANS=min(ANS,yoko+OK)

print(ANS)
    

0