結果

問題 No.2227 King Kraken's Attack
コンテスト
ユーザー ああいい
提出日時 2023-02-26 10:47:57
言語 PyPy3
(8.0.1 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 483 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 377 ms
コンパイル使用メモリ 64,640 KB
実行使用メモリ 58,624 KB
最終ジャッジ日時 2026-11-04 02:35:14
合計ジャッジ時間 6,220 ms
ジャッジサーバーID
(参考情報)
judge7_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 42 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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

ans = 10 ** 8


def calc(w,h):
    a = w * KB + h * KA
    gyo = min(w * LB,W)
    retu = min(h * LA,H)
    return a + gyo * retu >= H * W
for w in range(W + 1):
    if not calc(w,H + W - w):
        continue
    end = H + W - w
    start = -1
    while end -start > 1:
        mid = end +start >> 1
        if calc(w,mid):
            end = mid
        else:
            start = mid
    if w + end < ans:
        ans = w + end
print(ans)
0