結果
問題 | No.453 製薬会社 |
ユーザー |
![]() |
提出日時 | 2025-03-20 21:21:46 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 38 ms / 2,000 ms |
コード長 | 854 bytes |
コンパイル時間 | 188 ms |
コンパイル使用メモリ | 81,836 KB |
実行使用メモリ | 53,784 KB |
最終ジャッジ日時 | 2025-03-20 21:22:37 |
合計ジャッジ時間 | 1,322 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 9 |
ソースコード
C, D = map(int, input().split())# Calculate possible intersection point of the two constraintsnumerator_x = 20 * C - 8 * Dx = numerator_x / 13numerator_y = 7 * (3 * D - C)y = numerator_y / 13candidates = []# Check if the intersection is valid (non-negative)if x >= 0 and y >= 0:# Add the sales from the intersection pointcandidates.append(1000 * x + 2000 * y)# Calculate maximum sales if only producing product Ax_a = min(4 * C / 3, 4 * D)candidates.append(1000 * x_a)# Calculate maximum sales if only producing product By_b = min(7 * C / 2, 7 * D / 5)candidates.append(2000 * y_b)# Determine the maximum sales from all valid candidatesmax_sales = max(candidates)# Format the output to remove trailing zeros and unnecessary decimal pointsformatted = "{0:.12f}".format(max_sales).rstrip('0').rstrip('.')print(formatted)