結果

問題 No.1708 Quality of Contest
ユーザー puznekopuzneko
提出日時 2021-11-05 00:58:07
言語 PyPy3
(7.3.15)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 661 bytes
コンパイル時間 268 ms
コンパイル使用メモリ 82,360 KB
実行使用メモリ 169,300 KB
最終ジャッジ日時 2024-04-23 07:43:15
合計ジャッジ時間 33,307 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
52,824 KB
testcase_01 AC 41 ms
54,612 KB
testcase_02 AC 39 ms
53,040 KB
testcase_03 AC 109 ms
77,244 KB
testcase_04 AC 130 ms
77,656 KB
testcase_05 AC 117 ms
76,880 KB
testcase_06 AC 106 ms
76,824 KB
testcase_07 AC 111 ms
77,228 KB
testcase_08 AC 45 ms
53,552 KB
testcase_09 AC 1,249 ms
169,300 KB
testcase_10 TLE -
testcase_11 AC 1,936 ms
164,204 KB
testcase_12 AC 1,786 ms
163,560 KB
testcase_13 AC 1,943 ms
163,896 KB
testcase_14 AC 1,712 ms
163,864 KB
testcase_15 AC 1,507 ms
163,852 KB
testcase_16 AC 1,524 ms
164,048 KB
testcase_17 AC 1,826 ms
164,216 KB
testcase_18 AC 1,807 ms
163,948 KB
testcase_19 AC 1,707 ms
163,472 KB
testcase_20 AC 1,871 ms
163,712 KB
testcase_21 AC 1,540 ms
163,792 KB
testcase_22 AC 1,564 ms
163,412 KB
testcase_23 AC 1,443 ms
163,560 KB
testcase_24 TLE -
testcase_25 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import stdin
from heapq import heappush, heappop

n, m, x, *indata = map(int, stdin.read().split())
offset = 0
hq = []
for i in range(n):
    s, t = indata[offset + 2*i],indata[offset + 2*i+1]
    heappush(hq, (-(s+x),t,0))

used = [0 for i in range(m+1)]
manzoku = [0]
while hq:
    score, janru, appeared = heappop(hq)
    score = -score
    if (appeared == 0) & (used[janru] >= 1):
        heappush(hq,(-score+x,janru,1))
    else:
        kari = manzoku[-1] + score
        used[janru] += 1
        manzoku.append(kari)

ans = 0
offset += n * 2
k = indata[offset]
for i in range(1,k+1):
    ans += manzoku[indata[offset+i]]
print("{}".format(ans))
0