結果

問題 No.2227 King Kraken's Attack
ユーザー ttkkggwwttkkggww
提出日時 2023-02-24 22:17:33
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 638 bytes
コンパイル時間 4,196 ms
コンパイル使用メモリ 254,792 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-10 09:27:31
合計ジャッジ時間 9,525 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 1 ms
6,940 KB
testcase_05 AC 2 ms
6,948 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 2 ms
6,944 KB
testcase_09 AC 2 ms
6,944 KB
testcase_10 AC 1 ms
6,944 KB
testcase_11 AC 2 ms
6,940 KB
testcase_12 AC 2 ms
6,944 KB
testcase_13 AC 2 ms
6,940 KB
testcase_14 AC 190 ms
6,944 KB
testcase_15 AC 186 ms
6,944 KB
testcase_16 AC 184 ms
6,940 KB
testcase_17 AC 184 ms
6,944 KB
testcase_18 WA -
testcase_19 AC 181 ms
6,940 KB
testcase_20 AC 181 ms
6,944 KB
testcase_21 AC 187 ms
6,944 KB
testcase_22 AC 2 ms
6,940 KB
testcase_23 AC 1 ms
6,944 KB
testcase_24 AC 189 ms
6,940 KB
testcase_25 WA -
testcase_26 AC 186 ms
6,940 KB
testcase_27 WA -
testcase_28 AC 191 ms
6,940 KB
testcase_29 AC 183 ms
6,940 KB
testcase_30 AC 186 ms
6,944 KB
testcase_31 AC 174 ms
6,944 KB
testcase_32 AC 165 ms
6,940 KB
testcase_33 AC 102 ms
6,940 KB
testcase_34 AC 56 ms
6,940 KB
testcase_35 AC 154 ms
6,940 KB
testcase_36 AC 71 ms
6,944 KB
testcase_37 AC 36 ms
6,940 KB
testcase_38 WA -
testcase_39 AC 67 ms
6,940 KB
testcase_40 AC 42 ms
6,940 KB
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#include<atcoder/all>
using namespace atcoder;
using ll = long long;
ll H,W,LA,LB,KA,KB;

ll bs(ll A){//Akai punch
	ll yoko = min(H,LA*A);
	ll Aboth = min(H*W,KA*A);
	ll ng = -1,ok = 1e9;
	while(abs(ok-ng)>1){
		ll mid = (ok+ng)/2;
		ll tate = min(W,LB*mid);
		ll Bboth = min(H*W,KB*mid);
		if(tate*yoko+Aboth+Bboth>=H*W){
			ok = mid;
		}else{
			ng = mid;
		}
	}
	return ok;
}

void solve(){
	ll ans = 1e9;
	for(int i = 0;i<=H;i++){
		ans = min(ans,bs(i)+i);
	}
	cout<<ans<<endl;
}

signed main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cin >> H >> W>>LA>>LB>>KA>>KB;
	solve();
}
0