結果

問題 No.433 ICPC国内予選の選抜ルールがこんな感じだったらうれしい
ユーザー qibqib
提出日時 2023-02-23 00:27:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 640 ms / 4,000 ms
コード長 420 bytes
コンパイル時間 1,524 ms
コンパイル使用メモリ 86,644 KB
実行使用メモリ 115,780 KB
最終ジャッジ日時 2023-09-30 06:13:52
合計ジャッジ時間 23,893 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 631 ms
112,892 KB
testcase_01 AC 640 ms
111,812 KB
testcase_02 AC 594 ms
110,196 KB
testcase_03 AC 577 ms
110,460 KB
testcase_04 AC 567 ms
110,588 KB
testcase_05 AC 583 ms
110,128 KB
testcase_06 AC 617 ms
112,688 KB
testcase_07 AC 607 ms
111,860 KB
testcase_08 AC 613 ms
110,864 KB
testcase_09 AC 575 ms
109,972 KB
testcase_10 AC 499 ms
111,696 KB
testcase_11 AC 488 ms
112,868 KB
testcase_12 AC 490 ms
112,336 KB
testcase_13 AC 481 ms
111,416 KB
testcase_14 AC 487 ms
114,428 KB
testcase_15 AC 495 ms
115,540 KB
testcase_16 AC 485 ms
114,684 KB
testcase_17 AC 506 ms
113,216 KB
testcase_18 AC 515 ms
113,584 KB
testcase_19 AC 518 ms
111,592 KB
testcase_20 AC 501 ms
110,840 KB
testcase_21 AC 506 ms
110,940 KB
testcase_22 AC 508 ms
113,284 KB
testcase_23 AC 506 ms
111,668 KB
testcase_24 AC 501 ms
110,788 KB
testcase_25 AC 494 ms
113,108 KB
testcase_26 AC 485 ms
114,476 KB
testcase_27 AC 487 ms
114,628 KB
testcase_28 AC 509 ms
111,284 KB
testcase_29 AC 495 ms
115,780 KB
testcase_30 AC 96 ms
80,788 KB
testcase_31 AC 98 ms
80,916 KB
testcase_32 AC 521 ms
112,496 KB
testcase_33 AC 507 ms
111,708 KB
testcase_34 AC 595 ms
110,524 KB
testcase_35 AC 96 ms
80,744 KB
testcase_36 AC 94 ms
80,800 KB
testcase_37 AC 96 ms
80,592 KB
testcase_38 AC 95 ms
80,820 KB
testcase_39 AC 113 ms
81,156 KB
testcase_40 AC 113 ms
81,672 KB
testcase_41 AC 155 ms
84,104 KB
testcase_42 AC 153 ms
84,408 KB
testcase_43 AC 153 ms
84,160 KB
testcase_44 AC 154 ms
84,088 KB
testcase_45 AC 111 ms
81,484 KB
testcase_46 AC 156 ms
84,240 KB
testcase_47 AC 156 ms
84,196 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())

m = 10 ** 5

items = [[] for _ in range(m)]
for i in range(n):
  si, pi, ui = map(int, input().split())
  ui -= 1
  items[ui].append((si, pi, i))

teams = []
for ui in range(m):
  items[ui].sort(key=lambda x: (- x[0], x[1]))
  for j in range(len(items[ui])):
    si, pi, i = items[ui][j]
    teams.append((- si, j, pi, i))

teams.sort()
print(*[i for _, _, _, i in teams[:k]], sep="\n")
0