結果
| 問題 | No.2390 Udon Coupon (Hard) |
| コンテスト | |
| ユーザー |
👑 amentorimaru
|
| 提出日時 | 2023-07-03 21:41:49 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1,283 ms / 2,000 ms |
| + 256µs | |
| コード長 | 661 bytes |
| 記録 | |
| コンパイル時間 | 59 ms |
| コンパイル使用メモリ | 15,104 KB |
| 実行使用メモリ | 11,008 KB |
| 最終ジャッジ日時 | 2026-09-10 21:28:55 |
| 合計ジャッジ時間 | 16,525 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 47 |
ソースコード
import sys
input = sys.stdin.readline
def read_values(): return tuple(map(int, input().split()))
def main():
N = int(input())
A = [0] * 3
B = [0] * 3
for i in range(3):
A[i], B[i] = read_values()
if A[1] * B[2] < A[2] * B[1]:
A[1], A[2], B[1], B[2] = A[2], A[1], B[2], B[1]
if A[0] * B[2] < A[2] * B[0]:
A[0], A[2], B[0], B[2] = A[2], A[0], B[2], B[0]
ans=0
for i in range(A[2]):
for j in range(A[2]):
use = i*A[0]+j*A[1]
if use>N:
break
ans=max(ans,i*B[0]+j*B[1]+(N-use)//A[2]*B[2])
print(ans)
if __name__ == "__main__":
main()
amentorimaru