結果

問題 No.2227 King Kraken's Attack
ユーザー tamatotamato
提出日時 2023-02-24 21:40:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 458 ms / 2,000 ms
コード長 583 bytes
コンパイル時間 443 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 62,352 KB
最終ジャッジ日時 2024-04-10 09:16:19
合計ジャッジ時間 4,571 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
53,560 KB
testcase_01 AC 33 ms
52,828 KB
testcase_02 AC 34 ms
53,284 KB
testcase_03 AC 41 ms
60,304 KB
testcase_04 AC 35 ms
52,168 KB
testcase_05 AC 34 ms
53,012 KB
testcase_06 AC 42 ms
60,744 KB
testcase_07 AC 34 ms
52,888 KB
testcase_08 AC 36 ms
59,240 KB
testcase_09 AC 39 ms
58,424 KB
testcase_10 AC 33 ms
52,488 KB
testcase_11 AC 37 ms
59,708 KB
testcase_12 AC 38 ms
59,684 KB
testcase_13 AC 38 ms
59,116 KB
testcase_14 AC 454 ms
62,180 KB
testcase_15 AC 44 ms
58,864 KB
testcase_16 AC 150 ms
59,052 KB
testcase_17 AC 101 ms
59,276 KB
testcase_18 AC 34 ms
52,348 KB
testcase_19 AC 43 ms
60,900 KB
testcase_20 AC 42 ms
60,372 KB
testcase_21 AC 74 ms
60,984 KB
testcase_22 AC 38 ms
58,176 KB
testcase_23 AC 39 ms
58,364 KB
testcase_24 AC 84 ms
61,412 KB
testcase_25 AC 34 ms
52,312 KB
testcase_26 AC 458 ms
62,352 KB
testcase_27 AC 35 ms
52,136 KB
testcase_28 AC 46 ms
61,184 KB
testcase_29 AC 45 ms
60,992 KB
testcase_30 AC 93 ms
61,272 KB
testcase_31 AC 48 ms
60,916 KB
testcase_32 AC 43 ms
62,076 KB
testcase_33 AC 44 ms
60,624 KB
testcase_34 AC 42 ms
61,088 KB
testcase_35 AC 44 ms
60,580 KB
testcase_36 AC 45 ms
62,024 KB
testcase_37 AC 32 ms
52,756 KB
testcase_38 AC 33 ms
52,696 KB
testcase_39 AC 35 ms
52,624 KB
testcase_40 AC 35 ms
53,916 KB
testcase_41 AC 33 ms
52,648 KB
testcase_42 AC 32 ms
52,432 KB
testcase_43 AC 33 ms
52,452 KB
testcase_44 AC 34 ms
53,224 KB
testcase_45 AC 34 ms
52,884 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 998244353


def main():
    import sys
    input = sys.stdin.readline

    H, W, ah, aw, bh, bw = map(int, input().split())
    ok = H + W + 1
    ng = 0
    mid = (ok + ng) // 2
    while ok - ng > 1:
        flg = 0
        for num_h in range(mid + 1):
            num_w = mid - num_h
            if min(H, ah * num_h) * min(W, aw * num_w) + bh * num_h + bw * num_w >= H*W:
                flg = 1
                break
        if flg:
            ok = mid
        else:
            ng = mid
        mid = (ok + ng) // 2
    print(ok)


if __name__ == '__main__':
    main()
0