結果
問題 |
No.433 ICPC国内予選の選抜ルールがこんな感じだったらうれしい
|
ユーザー |
![]() |
提出日時 | 2016-07-14 12:46:48 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 1,035 ms / 4,000 ms |
コード長 | 955 bytes |
コンパイル時間 | 227 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 32,980 KB |
最終ジャッジ日時 | 2024-10-14 17:05:49 |
合計ジャッジ時間 | 36,130 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 48 |
ソースコード
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)