結果

問題 No.1430 Coup de Coupon
ユーザー NoaSaberNoaSaber
提出日時 2021-04-26 15:38:29
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 714 bytes
コンパイル時間 605 ms
コンパイル使用メモリ 86,676 KB
実行使用メモリ 412,264 KB
最終ジャッジ日時 2023-09-18 08:29:55
合計ジャッジ時間 14,072 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,184 KB
testcase_01 AC 69 ms
71,408 KB
testcase_02 AC 71 ms
71,076 KB
testcase_03 AC 97 ms
76,900 KB
testcase_04 AC 102 ms
77,128 KB
testcase_05 AC 96 ms
76,916 KB
testcase_06 AC 700 ms
411,896 KB
testcase_07 AC 688 ms
411,580 KB
testcase_08 AC 702 ms
412,180 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 77 ms
75,804 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,C=map(int,input().split())
P=[int(input()) for i in range(N)]
disc=[]
disc_per=[]
P.sort(reverse=True)
for i in range(C):
    t,x=map(int,input().split())
    if t==1:
        disc.append(x)
    else:
        disc_per.append(x)
disc_per.sort(reverse=True)
disc.sort(reverse=True)
posi,posi_per=0,0
dp=[[float("inf")]*(C+1) for i in range(N+1)]
dp[0][0]=0
for i in range(N):
    for j in range(C+1):
        if i-j<0:
            continue
        if i<=C-1:
            if j<len(disc):
                dp[i+1][j+1]=dp[i][j]+max(P[i]-disc[j],0)
            if i-j<len(disc_per):
                dp[i+1][j]=dp[i][j]+P[i]*(100-disc_per[i-j])//100
        else:
            dp[i+1][j]=dp[i][j]+P[i]
print(min(dp[-1]))
0