結果
問題 |
No.433 ICPC国内予選の選抜ルールがこんな感じだったらうれしい
|
ユーザー |
![]() |
提出日時 | 2016-07-14 13:02:34 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 1,125 ms / 4,000 ms |
コード長 | 960 bytes |
コンパイル時間 | 152 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 33,020 KB |
最終ジャッジ日時 | 2024-11-07 23:12:03 |
合計ジャッジ時間 | 38,814 ms |
ジャッジサーバーID (参考情報) |
judge5 / 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 = [None] * N for i in range(N): s, p, u = map(int, input().split()) teams[i] = 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)