結果

問題 No.2227 King Kraken's Attack
ユーザー rlangevinrlangevin
提出日時 2023-02-24 22:17:00
言語 PyPy3
(7.3.15)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 541 bytes
コンパイル時間 231 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 75,484 KB
最終ジャッジ日時 2024-04-10 09:27:22
合計ジャッジ時間 7,356 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
52,396 KB
testcase_01 AC 38 ms
52,260 KB
testcase_02 AC 35 ms
53,224 KB
testcase_03 AC 57 ms
67,212 KB
testcase_04 AC 36 ms
52,728 KB
testcase_05 AC 35 ms
52,200 KB
testcase_06 AC 36 ms
52,896 KB
testcase_07 AC 45 ms
63,472 KB
testcase_08 AC 36 ms
53,348 KB
testcase_09 AC 52 ms
65,036 KB
testcase_10 AC 41 ms
59,612 KB
testcase_11 AC 49 ms
63,852 KB
testcase_12 AC 53 ms
65,144 KB
testcase_13 AC 60 ms
69,072 KB
testcase_14 AC 45 ms
59,004 KB
testcase_15 AC 322 ms
60,944 KB
testcase_16 AC 44 ms
59,348 KB
testcase_17 AC 285 ms
64,204 KB
testcase_18 AC 48 ms
60,732 KB
testcase_19 AC 176 ms
63,620 KB
testcase_20 AC 192 ms
64,560 KB
testcase_21 AC 329 ms
73,924 KB
testcase_22 AC 35 ms
53,308 KB
testcase_23 AC 36 ms
52,556 KB
testcase_24 AC 166 ms
67,292 KB
testcase_25 AC 132 ms
60,828 KB
testcase_26 AC 44 ms
59,852 KB
testcase_27 AC 56 ms
63,324 KB
testcase_28 AC 415 ms
71,808 KB
testcase_29 AC 365 ms
74,176 KB
testcase_30 AC 443 ms
73,872 KB
testcase_31 AC 393 ms
72,388 KB
testcase_32 AC 376 ms
75,484 KB
testcase_33 AC 270 ms
72,356 KB
testcase_34 AC 170 ms
71,436 KB
testcase_35 AC 376 ms
73,452 KB
testcase_36 AC 187 ms
69,900 KB
testcase_37 AC 45 ms
60,656 KB
testcase_38 AC 45 ms
60,792 KB
testcase_39 AC 45 ms
61,064 KB
testcase_40 AC 44 ms
60,664 KB
testcase_41 AC 47 ms
60,952 KB
testcase_42 AC 44 ms
61,700 KB
testcase_43 AC 44 ms
61,880 KB
testcase_44 AC 47 ms
61,120 KB
testcase_45 WA -
権限があれば一括ダウンロードができます

ソースコード

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(H + 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