結果

問題 No.2227 King Kraken's Attack
ユーザー publfl2publfl2
提出日時 2023-02-24 22:03:35
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 552 bytes
コンパイル時間 261 ms
コンパイル使用メモリ 32,640 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-10 09:22:13
合計ジャッジ時間 6,874 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 2 ms
6,940 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 3 ms
6,940 KB
testcase_09 AC 2 ms
6,940 KB
testcase_10 AC 2 ms
6,940 KB
testcase_11 AC 2 ms
6,944 KB
testcase_12 AC 2 ms
6,940 KB
testcase_13 AC 2 ms
6,940 KB
testcase_14 AC 239 ms
6,944 KB
testcase_15 AC 242 ms
6,940 KB
testcase_16 AC 240 ms
6,944 KB
testcase_17 AC 302 ms
6,944 KB
testcase_18 AC 249 ms
6,944 KB
testcase_19 AC 241 ms
6,944 KB
testcase_20 AC 240 ms
6,940 KB
testcase_21 AC 240 ms
6,944 KB
testcase_22 AC 2 ms
6,940 KB
testcase_23 AC 2 ms
6,940 KB
testcase_24 AC 209 ms
6,944 KB
testcase_25 AC 266 ms
6,944 KB
testcase_26 AC 240 ms
6,940 KB
testcase_27 AC 246 ms
6,940 KB
testcase_28 AC 241 ms
6,944 KB
testcase_29 AC 240 ms
6,940 KB
testcase_30 AC 242 ms
6,940 KB
testcase_31 AC 232 ms
6,940 KB
testcase_32 AC 184 ms
6,944 KB
testcase_33 AC 118 ms
6,944 KB
testcase_34 AC 68 ms
6,944 KB
testcase_35 AC 180 ms
6,944 KB
testcase_36 AC 92 ms
6,944 KB
testcase_37 AC 56 ms
6,944 KB
testcase_38 AC 68 ms
6,944 KB
testcase_39 AC 77 ms
6,940 KB
testcase_40 AC 56 ms
6,944 KB
testcase_41 AC 214 ms
6,940 KB
testcase_42 AC 44 ms
6,940 KB
testcase_43 AC 53 ms
6,944 KB
testcase_44 AC 206 ms
6,944 KB
testcase_45 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#define MAX (long long int)1e16

int main()
{
	long long int a,b,c,d,e,f;
	scanf("%lld%lld%lld%lld%lld%lld",&a,&b,&c,&d,&e,&f);
	
	long long int ans = MAX;
	for(long long int i=0;i<=a;i++)
	{
		long long int min = 0, max = b;
		while(min<=max)
		{
			long long int h = (min+max)/2;
			long long int C1 = h/d, C2 = i/c;
			if(h%d!=0) C1++;
			if(i%c!=0) C2++;
			long long int S = i*C1 + h*C2;
			if(a*b - i*h <= C1 * f + C2 * e)
			{
				ans = ans<C1+C2?ans:C1+C2;
				max = h-1;
			}
			else min = h+1;
		}
	}
	printf("%lld",ans);
}
0