結果
問題 | No.1430 Coup de Coupon |
ユーザー | NoaSaber |
提出日時 | 2021-04-26 15:27:23 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 705 bytes |
コンパイル時間 | 786 ms |
コンパイル使用メモリ | 87,240 KB |
実行使用メモリ | 275,396 KB |
最終ジャッジ日時 | 2023-09-18 08:16:56 |
合計ジャッジ時間 | 11,463 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 72 ms
71,300 KB |
testcase_01 | AC | 70 ms
71,444 KB |
testcase_02 | AC | 71 ms
71,480 KB |
testcase_03 | WA | - |
testcase_04 | AC | 101 ms
76,972 KB |
testcase_05 | AC | 98 ms
76,996 KB |
testcase_06 | AC | 500 ms
274,008 KB |
testcase_07 | AC | 496 ms
274,660 KB |
testcase_08 | AC | 518 ms
274,572 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 | 76 ms
75,612 KB |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | WA | - |
ソースコード
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=[[10**9]*(C+1) for i in range(N+1)] dp[0][0]=0 for i in range(N): for j in range(C): 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]))