結果

問題 No.433 ICPC国内予選の選抜ルールがこんな感じだったらうれしい
ユーザー ichibanshiboriichibanshibori
提出日時 2016-10-15 00:01:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 758 ms / 4,000 ms
コード長 504 bytes
コンパイル時間 861 ms
コンパイル使用メモリ 10,740 KB
実行使用メモリ 38,300 KB
最終ジャッジ日時 2023-08-14 11:25:14
合計ジャッジ時間 27,371 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 740 ms
38,300 KB
testcase_01 AC 707 ms
38,284 KB
testcase_02 AC 690 ms
37,136 KB
testcase_03 AC 715 ms
37,980 KB
testcase_04 AC 719 ms
37,748 KB
testcase_05 AC 708 ms
36,972 KB
testcase_06 AC 727 ms
38,136 KB
testcase_07 AC 685 ms
38,164 KB
testcase_08 AC 693 ms
37,216 KB
testcase_09 AC 704 ms
38,188 KB
testcase_10 AC 715 ms
35,616 KB
testcase_11 AC 739 ms
35,668 KB
testcase_12 AC 718 ms
35,632 KB
testcase_13 AC 699 ms
35,688 KB
testcase_14 AC 701 ms
35,624 KB
testcase_15 AC 664 ms
35,656 KB
testcase_16 AC 732 ms
35,568 KB
testcase_17 AC 734 ms
35,624 KB
testcase_18 AC 733 ms
35,608 KB
testcase_19 AC 704 ms
35,720 KB
testcase_20 AC 695 ms
35,744 KB
testcase_21 AC 709 ms
35,764 KB
testcase_22 AC 734 ms
35,752 KB
testcase_23 AC 714 ms
35,620 KB
testcase_24 AC 688 ms
35,760 KB
testcase_25 AC 714 ms
35,764 KB
testcase_26 AC 704 ms
35,680 KB
testcase_27 AC 719 ms
35,604 KB
testcase_28 AC 695 ms
35,636 KB
testcase_29 AC 713 ms
35,756 KB
testcase_30 AC 15 ms
7,856 KB
testcase_31 AC 16 ms
7,744 KB
testcase_32 AC 747 ms
36,500 KB
testcase_33 AC 758 ms
36,892 KB
testcase_34 AC 723 ms
37,960 KB
testcase_35 AC 16 ms
7,748 KB
testcase_36 AC 16 ms
7,756 KB
testcase_37 AC 16 ms
7,900 KB
testcase_38 AC 16 ms
7,748 KB
testcase_39 AC 22 ms
8,172 KB
testcase_40 AC 21 ms
8,132 KB
testcase_41 AC 73 ms
10,952 KB
testcase_42 AC 73 ms
10,868 KB
testcase_43 AC 69 ms
10,876 KB
testcase_44 AC 68 ms
10,860 KB
testcase_45 AC 22 ms
8,444 KB
testcase_46 AC 81 ms
10,852 KB
testcase_47 AC 80 ms
11,032 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = tuple(int(i) for i in input().split())
team_lst = []
school_dic = {}

for i in range(N):
    sn, pn, un = tuple(int(i) for i in input().split())
    team_lst += [(sn, -pn, un, i)]

team_lst = sorted(team_lst, reverse=True)

team_lst2 = []
for r in team_lst:
    sn, pn, un, idx = r
    sum_un = school_dic.get(un, 0) + 1
    school_dic[un] = sum_un
    team_lst2 += [(sn, -sum_un, pn, idx)]

team_lst2 = sorted(team_lst2, reverse=True)

for r in team_lst2[:K]:
    _, _, _, idx = r
    print(r[3])
0