結果

問題 No.2227 King Kraken's Attack
ユーザー Manuel1024Manuel1024
提出日時 2023-12-27 21:35:03
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 276 ms / 2,000 ms
コード長 496 bytes
コンパイル時間 607 ms
コンパイル使用メモリ 67,188 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2023-12-27 21:35:18
合計ジャッジ時間 14,951 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 243 ms
6,676 KB
testcase_01 AC 255 ms
6,676 KB
testcase_02 AC 241 ms
6,676 KB
testcase_03 AC 247 ms
6,676 KB
testcase_04 AC 254 ms
6,676 KB
testcase_05 AC 242 ms
6,676 KB
testcase_06 AC 265 ms
6,676 KB
testcase_07 AC 254 ms
6,676 KB
testcase_08 AC 254 ms
6,676 KB
testcase_09 AC 248 ms
6,676 KB
testcase_10 AC 241 ms
6,676 KB
testcase_11 AC 250 ms
6,676 KB
testcase_12 AC 242 ms
6,676 KB
testcase_13 AC 242 ms
6,676 KB
testcase_14 AC 250 ms
6,676 KB
testcase_15 AC 241 ms
6,676 KB
testcase_16 AC 254 ms
6,676 KB
testcase_17 AC 252 ms
6,676 KB
testcase_18 AC 242 ms
6,676 KB
testcase_19 AC 254 ms
6,676 KB
testcase_20 AC 271 ms
6,676 KB
testcase_21 AC 254 ms
6,676 KB
testcase_22 AC 254 ms
6,676 KB
testcase_23 AC 251 ms
6,676 KB
testcase_24 AC 254 ms
6,676 KB
testcase_25 AC 255 ms
6,676 KB
testcase_26 AC 254 ms
6,676 KB
testcase_27 AC 243 ms
6,676 KB
testcase_28 AC 254 ms
6,676 KB
testcase_29 AC 256 ms
6,676 KB
testcase_30 AC 255 ms
6,676 KB
testcase_31 AC 254 ms
6,676 KB
testcase_32 AC 254 ms
6,676 KB
testcase_33 AC 255 ms
6,676 KB
testcase_34 AC 254 ms
6,676 KB
testcase_35 AC 253 ms
6,676 KB
testcase_36 AC 276 ms
6,676 KB
testcase_37 AC 242 ms
6,676 KB
testcase_38 AC 241 ms
6,676 KB
testcase_39 AC 241 ms
6,676 KB
testcase_40 AC 242 ms
6,676 KB
testcase_41 AC 242 ms
6,676 KB
testcase_42 AC 241 ms
6,676 KB
testcase_43 AC 241 ms
6,676 KB
testcase_44 AC 241 ms
6,676 KB
testcase_45 AC 241 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
using namespace std;
using ll = long long;

int main(){
    ll h, w, la, lb, ka, kb; cin >> h >> w >> la >> lb >> ka >> kb;

    int ans = 1 << 30;
    for(int x = 0; x <= 2e6; x++){
        int ac = 2e6, wa = -1;
        while(ac-wa > 1){
            int wj = (ac+wa)/2;
            ll z = ka*x+kb*wj+min(la*x, h)*min(lb*wj, w);
            (h*w <= z ? ac : wa) = wj;
        }
        ans = min(ans, x+ac);
    }
    cout << ans << endl;
    return 0;
}
0