結果

問題 No.1430 Coup de Coupon
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2021-03-14 14:16:54
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 576 bytes
コンパイル時間 358 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 77,312 KB
最終ジャッジ日時 2024-04-23 21:45:51
合計ジャッジ時間 3,325 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
52,096 KB
testcase_01 AC 41 ms
51,968 KB
testcase_02 AC 36 ms
51,712 KB
testcase_03 AC 65 ms
68,608 KB
testcase_04 AC 64 ms
70,144 KB
testcase_05 AC 64 ms
70,272 KB
testcase_06 AC 88 ms
76,672 KB
testcase_07 AC 90 ms
76,892 KB
testcase_08 AC 90 ms
76,652 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 AC 95 ms
76,672 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 42 ms
52,736 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)]
l = [[] for i in range(2)]
for i in range(c):
    t,x = map(int,input().split())
    if t == 1:
        l[0].append(x)
    else:
        l[1].append(x)

P.sort(reverse=True)
l[0].sort(reverse=True)
l[1].sort(reverse=True)

ans = sum(P)
n0 = 0
n1 = 0
for p in P:
    dis1 = 0
    dis2 = 0
    if n0 < len(l[0]):
        dis1 = min(l[0][n0],p)
    if n1 < len(l[1]):
        dis2 = p*l[1][n1]//100
    if dis1 > dis2:
        ans -= dis1
        n0 += 1
    else:
        ans -= dis2
        n1 += 1
print(ans)
0