結果
問題 | No.1430 Coup de Coupon |
ユーザー | gorugo30 |
提出日時 | 2021-03-14 14:41:44 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 518 bytes |
コンパイル時間 | 308 ms |
コンパイル使用メモリ | 82,396 KB |
実行使用メモリ | 78,096 KB |
最終ジャッジ日時 | 2024-04-23 22:23:21 |
合計ジャッジ時間 | 8,681 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 38 ms
51,840 KB |
testcase_01 | AC | 38 ms
52,224 KB |
testcase_02 | AC | 37 ms
51,968 KB |
testcase_03 | AC | 63 ms
68,992 KB |
testcase_04 | AC | 74 ms
74,624 KB |
testcase_05 | AC | 62 ms
74,368 KB |
testcase_06 | AC | 366 ms
77,056 KB |
testcase_07 | AC | 392 ms
77,212 KB |
testcase_08 | AC | 401 ms
77,056 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 | 368 ms
77,952 KB |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | AC | 48 ms
60,800 KB |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | WA | - |
ソースコード
N, C = map(int, input().split()) P = [int(input()) for i in range(N)] Cs = [list(map(int, input().split())) for i in range(C)] P.sort(reverse = True) ans = sum(P) used = [0] * C for i in range(N): maxd = 0 use = -1 for j in range(C): if used[j]: continue if Cs[j][0] == 1: d = P[i] - max(P[i] - Cs[j][1], 0) else: d = P[i] * Cs[j][1] //100 if d > maxd: use = j maxd = d used[use] = 1 ans -= maxd print(ans)