結果

問題 No.1708 Quality of Contest
ユーザー lllllll88938494lllllll88938494
提出日時 2022-06-04 05:49:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,082 ms / 2,000 ms
コード長 424 bytes
コンパイル時間 148 ms
コンパイル使用メモリ 81,812 KB
実行使用メモリ 142,252 KB
最終ジャッジ日時 2023-10-21 02:34:30
合計ジャッジ時間 20,979 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,464 KB
testcase_01 AC 37 ms
53,464 KB
testcase_02 AC 38 ms
53,464 KB
testcase_03 AC 89 ms
76,476 KB
testcase_04 AC 82 ms
76,740 KB
testcase_05 AC 80 ms
76,616 KB
testcase_06 AC 77 ms
76,468 KB
testcase_07 AC 76 ms
76,480 KB
testcase_08 AC 35 ms
53,480 KB
testcase_09 AC 1,044 ms
142,252 KB
testcase_10 AC 879 ms
122,024 KB
testcase_11 AC 1,026 ms
122,020 KB
testcase_12 AC 1,036 ms
121,984 KB
testcase_13 AC 979 ms
121,844 KB
testcase_14 AC 1,073 ms
124,288 KB
testcase_15 AC 947 ms
129,424 KB
testcase_16 AC 1,066 ms
128,888 KB
testcase_17 AC 996 ms
123,012 KB
testcase_18 AC 993 ms
123,368 KB
testcase_19 AC 1,014 ms
124,604 KB
testcase_20 AC 1,007 ms
123,032 KB
testcase_21 AC 1,082 ms
125,652 KB
testcase_22 AC 1,008 ms
124,300 KB
testcase_23 AC 1,011 ms
129,020 KB
testcase_24 AC 884 ms
120,616 KB
testcase_25 AC 892 ms
120,756 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m,x=map(int,input().split())
ns=[list(map(int,input().split())) for i in range(n)]
k=int(input())
c=list(map(int,input().split()))
ns.sort(reverse=True)
now=-1
s=set()
for i in range(n):
    if ns[i][1] not in s:
        ns[i][0]+=x
        s.add(ns[i][1])
ns.sort(reverse=True)
for i in range(n-1):
    ns[i+1][0]+=ns[i][0]
ans=0    
for i in range(k):
    if c[i] == 0: continue
    ans+= ns[c[i]-1][0]
print(ans)
    

0