結果

問題 No.2390 Udon Coupon (Hard)
ユーザー pitPpitP
提出日時 2023-07-22 11:58:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 165 ms / 2,000 ms
コード長 431 bytes
コンパイル時間 278 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 64,000 KB
最終ジャッジ日時 2024-04-15 21:07:47
合計ジャッジ時間 7,503 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
61,696 KB
testcase_01 AC 132 ms
61,568 KB
testcase_02 AC 136 ms
61,824 KB
testcase_03 AC 133 ms
61,184 KB
testcase_04 AC 129 ms
61,840 KB
testcase_05 AC 84 ms
61,824 KB
testcase_06 AC 131 ms
61,824 KB
testcase_07 AC 61 ms
59,776 KB
testcase_08 AC 61 ms
59,904 KB
testcase_09 AC 131 ms
61,696 KB
testcase_10 AC 150 ms
62,464 KB
testcase_11 AC 71 ms
61,568 KB
testcase_12 AC 71 ms
61,696 KB
testcase_13 AC 69 ms
61,568 KB
testcase_14 AC 165 ms
64,000 KB
testcase_15 AC 163 ms
62,592 KB
testcase_16 AC 154 ms
62,752 KB
testcase_17 AC 67 ms
61,952 KB
testcase_18 AC 74 ms
61,952 KB
testcase_19 AC 72 ms
61,696 KB
testcase_20 AC 62 ms
59,904 KB
testcase_21 AC 61 ms
60,160 KB
testcase_22 AC 133 ms
61,696 KB
testcase_23 AC 133 ms
61,440 KB
testcase_24 AC 131 ms
61,440 KB
testcase_25 AC 131 ms
61,568 KB
testcase_26 AC 131 ms
61,696 KB
testcase_27 AC 130 ms
61,568 KB
testcase_28 AC 131 ms
61,696 KB
testcase_29 AC 132 ms
61,312 KB
testcase_30 AC 132 ms
61,696 KB
testcase_31 AC 132 ms
61,312 KB
testcase_32 AC 132 ms
61,440 KB
testcase_33 AC 128 ms
61,312 KB
testcase_34 AC 132 ms
62,080 KB
testcase_35 AC 130 ms
62,080 KB
testcase_36 AC 130 ms
61,440 KB
testcase_37 AC 131 ms
61,568 KB
testcase_38 AC 135 ms
62,080 KB
testcase_39 AC 132 ms
61,568 KB
testcase_40 AC 132 ms
61,696 KB
testcase_41 AC 129 ms
61,696 KB
testcase_42 AC 134 ms
62,080 KB
testcase_43 AC 130 ms
61,312 KB
testcase_44 AC 130 ms
62,080 KB
testcase_45 AC 132 ms
61,312 KB
testcase_46 AC 133 ms
61,184 KB
testcase_47 AC 132 ms
61,440 KB
testcase_48 AC 130 ms
61,440 KB
testcase_49 AC 62 ms
59,648 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# yu_w
N=int(input())
AB=[list(map(int,input().split())) for _ in range(3)]

ls=[[AB[i][1]/AB[i][0],AB[i][0],AB[i][1]] for i in range(3)]
ls.sort()


ans=0
for i in range(2000):
    inum=ls[0][1]*i
    for j in range(2000):
        jnum=ls[1][1]*j
 
        if N-inum-jnum<0:
            continue
        k=(N-inum-jnum)//ls[2][1]
    
        tmp=i*ls[0][2]+j*ls[1][2]+k*ls[2][2]
        ans=max(ans,tmp)
        
print(ans)





0