結果

問題 No.2390 Udon Coupon (Hard)
ユーザー 👑 MizarMizar
提出日時 2023-07-04 01:34:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 469 bytes
コンパイル時間 307 ms
コンパイル使用メモリ 82,816 KB
実行使用メモリ 76,288 KB
最終ジャッジ日時 2024-04-15 20:51:21
合計ジャッジ時間 5,190 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
51,584 KB
testcase_01 AC 45 ms
58,496 KB
testcase_02 AC 46 ms
58,368 KB
testcase_03 AC 52 ms
60,160 KB
testcase_04 AC 45 ms
59,136 KB
testcase_05 AC 84 ms
75,648 KB
testcase_06 AC 39 ms
52,224 KB
testcase_07 AC 40 ms
51,712 KB
testcase_08 AC 41 ms
51,584 KB
testcase_09 AC 97 ms
75,648 KB
testcase_10 AC 45 ms
58,240 KB
testcase_11 AC 39 ms
51,584 KB
testcase_12 AC 39 ms
51,712 KB
testcase_13 AC 46 ms
57,984 KB
testcase_14 AC 43 ms
58,368 KB
testcase_15 AC 39 ms
51,840 KB
testcase_16 AC 39 ms
51,584 KB
testcase_17 AC 46 ms
58,496 KB
testcase_18 AC 46 ms
58,368 KB
testcase_19 AC 45 ms
58,752 KB
testcase_20 AC 39 ms
51,840 KB
testcase_21 AC 38 ms
51,968 KB
testcase_22 AC 45 ms
58,880 KB
testcase_23 AC 48 ms
59,776 KB
testcase_24 AC 72 ms
75,392 KB
testcase_25 AC 73 ms
75,648 KB
testcase_26 AC 74 ms
75,264 KB
testcase_27 AC 74 ms
75,648 KB
testcase_28 AC 73 ms
75,264 KB
testcase_29 AC 96 ms
76,288 KB
testcase_30 AC 109 ms
75,776 KB
testcase_31 AC 96 ms
76,288 KB
testcase_32 AC 98 ms
75,648 KB
testcase_33 AC 98 ms
75,776 KB
testcase_34 AC 126 ms
75,520 KB
testcase_35 AC 122 ms
75,904 KB
testcase_36 AC 119 ms
76,160 KB
testcase_37 AC 121 ms
75,776 KB
testcase_38 AC 126 ms
76,032 KB
testcase_39 AC 113 ms
75,520 KB
testcase_40 AC 80 ms
75,264 KB
testcase_41 AC 110 ms
75,648 KB
testcase_42 AC 89 ms
75,136 KB
testcase_43 AC 86 ms
75,520 KB
testcase_44 AC 46 ms
58,880 KB
testcase_45 AC 53 ms
65,536 KB
testcase_46 AC 46 ms
58,752 KB
testcase_47 AC 45 ms
58,752 KB
testcase_48 AC 53 ms
62,848 KB
testcase_49 AC 40 ms
51,840 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
[[a1, b1], [a2, b2], [a3, b3]] = [list(map(int, input().split())) for _ in range(3)]
assert n > 0 and a1 > 0 and a2 > 0 and a3 > 0 and b1 > 0 and b2 > 0 and b3 > 0
if a2 * b1 < a1 * b2:
	a1, b1, a2, b2 = a2, b2, a1, b1
if a3 * b1 < a1 * b3:
	a1, b1, a3, b3 = a3, b3, a1, b1
print(
	max(
		max(
			dj // a1 * b1 + i + j
			for j, dj in zip(range(0, a1 * b3, b3), range(di, -1, -a3))
		)
		for i, di in zip(range(0, a1 * b2, b2), range(n, -1, -a2))
	)
)
0