結果

問題 No.433 ICPC国内予選の選抜ルールがこんな感じだったらうれしい
ユーザー 🍡yurahuna
提出日時 2016-07-14 12:52:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,068 ms / 4,000 ms
コード長 955 bytes
コンパイル時間 450 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 92,080 KB
最終ジャッジ日時 2024-11-07 23:08:58
合計ジャッジ時間 37,543 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 48
権限があれば一括ダウンロードができます

ソースコード

diff #

class Data:
    def __init__(self, id_team, id_univ, ac, ue, pena):
        self.id_team    =   id_team
        self.id_univ    =   id_univ
        self.ac         =   ac
        self.ue         =   ue
        self.pena       =   pena
    def __lt__(self, other):
        if self.ac != other.ac:  return self.ac > other.ac
        if self.ue != other.ue:  return self.ue < other.ue
        return self.pena < other.pena
    def printMembers(self):
        print(self.id_team, self.id_univ, self.ac, self.ue, self.pena)


N, K = map(int, input().split())
teams = []
for i in range(N):
    s, p, u = map(int, input().split())
    teams.append(Data(i, u, s, 0, p))
teams.sort()
# for p in teams:
#     p.printMembers()
# print()

MAX_UNIV = 100001
cnt_ue = [0] * MAX_UNIV
for team in teams:
    team.ue = cnt_ue[team.id_univ]
    cnt_ue[team.id_univ] += 1

teams.sort()
# for p in teams:
#     p.printMembers()
for team in teams[:K]:
    print(team.id_team)
0