結果

問題 No.433 ICPC国内予選の選抜ルールがこんな感じだったらうれしい
ユーザー roarisroaris
提出日時 2019-12-14 21:05:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 698 ms / 4,000 ms
コード長 330 bytes
コンパイル時間 523 ms
コンパイル使用メモリ 86,572 KB
実行使用メモリ 116,892 KB
最終ジャッジ日時 2023-09-10 12:05:59
合計ジャッジ時間 27,596 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 616 ms
116,024 KB
testcase_01 AC 614 ms
115,860 KB
testcase_02 AC 622 ms
116,220 KB
testcase_03 AC 633 ms
116,372 KB
testcase_04 AC 640 ms
116,328 KB
testcase_05 AC 622 ms
115,948 KB
testcase_06 AC 626 ms
115,752 KB
testcase_07 AC 620 ms
116,020 KB
testcase_08 AC 622 ms
116,012 KB
testcase_09 AC 641 ms
115,812 KB
testcase_10 AC 680 ms
116,752 KB
testcase_11 AC 687 ms
116,700 KB
testcase_12 AC 677 ms
116,804 KB
testcase_13 AC 684 ms
116,624 KB
testcase_14 AC 684 ms
116,476 KB
testcase_15 AC 635 ms
116,892 KB
testcase_16 AC 692 ms
116,600 KB
testcase_17 AC 692 ms
116,800 KB
testcase_18 AC 698 ms
116,544 KB
testcase_19 AC 681 ms
116,804 KB
testcase_20 AC 684 ms
116,216 KB
testcase_21 AC 682 ms
116,480 KB
testcase_22 AC 688 ms
116,544 KB
testcase_23 AC 688 ms
116,548 KB
testcase_24 AC 678 ms
116,744 KB
testcase_25 AC 692 ms
116,636 KB
testcase_26 AC 669 ms
116,888 KB
testcase_27 AC 690 ms
116,732 KB
testcase_28 AC 680 ms
116,624 KB
testcase_29 AC 685 ms
116,412 KB
testcase_30 AC 74 ms
71,364 KB
testcase_31 AC 73 ms
71,368 KB
testcase_32 AC 660 ms
116,784 KB
testcase_33 AC 674 ms
116,292 KB
testcase_34 AC 639 ms
115,764 KB
testcase_35 AC 72 ms
71,228 KB
testcase_36 AC 72 ms
71,236 KB
testcase_37 AC 72 ms
70,936 KB
testcase_38 AC 74 ms
71,104 KB
testcase_39 AC 95 ms
76,140 KB
testcase_40 AC 93 ms
76,380 KB
testcase_41 AC 149 ms
79,504 KB
testcase_42 AC 149 ms
79,532 KB
testcase_43 AC 140 ms
79,408 KB
testcase_44 AC 140 ms
79,328 KB
testcase_45 AC 98 ms
76,468 KB
testcase_46 AC 150 ms
79,428 KB
testcase_47 AC 154 ms
79,464 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())
SPU = [tuple(map(int, input().split()))+(i,) for i in range(N)]
SPU.sort(key=lambda k: (-k[0], k[1]))
cnt = [0]*(N+1)
SPU_ = []

for Si, Pi, Ui, i in SPU:
    SPU_.append((Si, cnt[Ui], Pi, i))
    cnt[Ui] += 1

SPU_.sort(key=lambda k: (-k[0], k[1], k[2]))

for _, _, _, i in SPU_[:K]:
    print(i)
0