結果

問題 No.2390 Udon Coupon (Hard)
ユーザー 👑 amentorimaruamentorimaru
提出日時 2023-07-03 21:41:49
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 661 bytes
コンパイル時間 196 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 16,256 KB
最終ジャッジ日時 2024-04-15 20:50:30
合計ジャッジ時間 16,633 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,496 KB
testcase_01 AC 32 ms
10,624 KB
testcase_02 AC 32 ms
10,496 KB
testcase_03 AC 35 ms
10,496 KB
testcase_04 AC 35 ms
10,496 KB
testcase_05 AC 429 ms
10,624 KB
testcase_06 AC 29 ms
10,496 KB
testcase_07 AC 28 ms
10,752 KB
testcase_08 AC 29 ms
10,752 KB
testcase_09 AC 1,317 ms
10,624 KB
testcase_10 AC 31 ms
10,752 KB
testcase_11 AC 29 ms
10,496 KB
testcase_12 AC 29 ms
10,496 KB
testcase_13 AC 29 ms
10,624 KB
testcase_14 AC 29 ms
10,496 KB
testcase_15 AC 29 ms
10,624 KB
testcase_16 AC 29 ms
10,752 KB
testcase_17 AC 30 ms
10,496 KB
testcase_18 AC 29 ms
10,624 KB
testcase_19 AC 29 ms
10,624 KB
testcase_20 AC 29 ms
10,496 KB
testcase_21 AC 27 ms
10,496 KB
testcase_22 AC 35 ms
10,624 KB
testcase_23 AC 35 ms
10,496 KB
testcase_24 AC 471 ms
10,496 KB
testcase_25 AC 494 ms
10,496 KB
testcase_26 AC 531 ms
10,624 KB
testcase_27 AC 516 ms
10,752 KB
testcase_28 AC 473 ms
10,624 KB
testcase_29 AC 1,460 ms
10,496 KB
testcase_30 AC 1,377 ms
10,496 KB
testcase_31 AC 1,411 ms
10,496 KB
testcase_32 AC 1,482 ms
10,624 KB
testcase_33 AC 1,462 ms
10,752 KB
testcase_34 TLE -
testcase_35 TLE -
testcase_36 TLE -
testcase_37 TLE -
testcase_38 TLE -
testcase_39 AC 1,334 ms
10,496 KB
testcase_40 AC 786 ms
10,496 KB
testcase_41 AC 1,233 ms
10,624 KB
testcase_42 AC 789 ms
10,624 KB
testcase_43 AC 1,118 ms
10,496 KB
testcase_44 AC 75 ms
10,624 KB
testcase_45 AC 325 ms
10,752 KB
testcase_46 AC 39 ms
10,496 KB
testcase_47 AC 31 ms
10,624 KB
testcase_48 AC 107 ms
10,496 KB
testcase_49 AC 31 ms
10,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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()
0