結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
54,044 KB
testcase_01 AC 35 ms
52,608 KB
testcase_02 AC 36 ms
53,628 KB
testcase_03 AC 48 ms
62,248 KB
testcase_04 AC 37 ms
52,488 KB
testcase_05 AC 36 ms
52,736 KB
testcase_06 AC 45 ms
61,780 KB
testcase_07 AC 35 ms
52,344 KB
testcase_08 AC 44 ms
60,388 KB
testcase_09 WA -
testcase_10 AC 38 ms
52,604 KB
testcase_11 AC 45 ms
61,284 KB
testcase_12 AC 42 ms
59,580 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 35 ms
52,620 KB
testcase_16 AC 203 ms
60,256 KB
testcase_17 WA -
testcase_18 AC 47 ms
58,756 KB
testcase_19 AC 45 ms
61,840 KB
testcase_20 AC 46 ms
61,088 KB
testcase_21 WA -
testcase_22 AC 36 ms
52,956 KB
testcase_23 AC 37 ms
53,660 KB
testcase_24 AC 103 ms
61,120 KB
testcase_25 AC 157 ms
60,884 KB
testcase_26 WA -
testcase_27 AC 45 ms
59,976 KB
testcase_28 AC 65 ms
67,208 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 64 ms
65,380 KB
testcase_32 AC 51 ms
63,664 KB
testcase_33 AC 57 ms
66,260 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 AC 36 ms
53,668 KB
testcase_39 AC 35 ms
53,036 KB
testcase_40 AC 35 ms
52,616 KB
testcase_41 AC 36 ms
53,444 KB
testcase_42 AC 35 ms
52,388 KB
testcase_43 AC 37 ms
52,924 KB
testcase_44 AC 35 ms
52,336 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:
        no_damage=0
        yoko_damage-=KA*yoko-no_damage

    #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