結果

問題 No.2390 Udon Coupon (Hard)
ユーザー 👑 amentorimaruamentorimaru
提出日時 2023-07-03 22:09:13
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 663 bytes
コンパイル時間 242 ms
コンパイル使用メモリ 10,964 KB
実行使用メモリ 7,972 KB
最終ジャッジ日時 2023-09-26 08:07:45
合計ジャッジ時間 24,874 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,772 KB
testcase_01 AC 17 ms
7,744 KB
testcase_02 AC 19 ms
7,932 KB
testcase_03 AC 21 ms
7,780 KB
testcase_04 AC 20 ms
7,932 KB
testcase_05 AC 325 ms
7,828 KB
testcase_06 AC 16 ms
7,756 KB
testcase_07 AC 16 ms
7,740 KB
testcase_08 AC 16 ms
7,932 KB
testcase_09 AC 1,006 ms
7,816 KB
testcase_10 AC 18 ms
7,832 KB
testcase_11 AC 16 ms
7,744 KB
testcase_12 AC 16 ms
7,812 KB
testcase_13 AC 17 ms
7,740 KB
testcase_14 AC 17 ms
7,716 KB
testcase_15 AC 16 ms
7,784 KB
testcase_16 AC 16 ms
7,896 KB
testcase_17 AC 18 ms
7,780 KB
testcase_18 AC 17 ms
7,852 KB
testcase_19 AC 16 ms
7,756 KB
testcase_20 AC 16 ms
7,824 KB
testcase_21 AC 17 ms
7,832 KB
testcase_22 AC 21 ms
7,752 KB
testcase_23 AC 22 ms
7,784 KB
testcase_24 AC 363 ms
7,832 KB
testcase_25 AC 372 ms
7,872 KB
testcase_26 AC 400 ms
7,744 KB
testcase_27 AC 381 ms
7,696 KB
testcase_28 AC 350 ms
7,832 KB
testcase_29 AC 1,114 ms
7,740 KB
testcase_30 AC 1,046 ms
7,744 KB
testcase_31 AC 1,079 ms
7,792 KB
testcase_32 AC 1,123 ms
7,816 KB
testcase_33 AC 1,109 ms
7,776 KB
testcase_34 TLE -
testcase_35 AC 1,957 ms
7,848 KB
testcase_36 AC 1,920 ms
7,784 KB
testcase_37 AC 1,979 ms
7,820 KB
testcase_38 TLE -
testcase_39 AC 975 ms
7,764 KB
testcase_40 AC 577 ms
7,896 KB
testcase_41 AC 904 ms
7,816 KB
testcase_42 AC 569 ms
7,704 KB
testcase_43 AC 499 ms
7,900 KB
testcase_44 AC 19 ms
7,696 KB
testcase_45 AC 111 ms
7,752 KB
testcase_46 AC 23 ms
7,828 KB
testcase_47 AC 16 ms
7,760 KB
testcase_48 AC 73 ms
7,776 KB
testcase_49 AC 16 ms
7,780 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