結果

問題 No.433 ICPC国内予選の選抜ルールがこんな感じだったらうれしい
ユーザー roiti46roiti46
提出日時 2016-10-14 22:46:04
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 502 bytes
コンパイル時間 111 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 45,128 KB
最終ジャッジ日時 2024-11-22 08:05:15
合計ジャッジ時間 32,332 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4 WA * 44
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-
import sys,copy,math,heapq,itertools as it,fractions,re,bisect,collections as coll
import heapq

N, K = map(int, raw_input().split())
SPU = [map(int, raw_input().split()) for i in xrange(N)]
SPU = [[S, P, U, i] for i, (S, P, U) in enumerate(SPU)]
SPU.sort(key = lambda x: x[1])
SPU.sort(key = lambda x: -x[0])

C = [0]*100005
ans = []
for S, P, U, i in SPU:
    ans.append([10**16*S - C[U]*10**6 + P, i])
    C[U] += 1
ans.sort(reverse = True)

for _, i in ans[:K]:
    print i
0