結果

問題 No.433 ICPC国内予選の選抜ルールがこんな感じだったらうれしい
ユーザー tktk_snsntktk_snsn
提出日時 2021-01-14 01:34:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 287 ms / 4,000 ms
コード長 819 bytes
コンパイル時間 179 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 92,928 KB
最終ジャッジ日時 2024-05-02 10:35:03
合計ジャッジ時間 10,553 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 252 ms
90,752 KB
testcase_01 AC 209 ms
89,856 KB
testcase_02 AC 137 ms
89,728 KB
testcase_03 AC 204 ms
90,368 KB
testcase_04 AC 210 ms
90,240 KB
testcase_05 AC 172 ms
89,856 KB
testcase_06 AC 287 ms
92,928 KB
testcase_07 AC 141 ms
89,728 KB
testcase_08 AC 261 ms
92,544 KB
testcase_09 AC 235 ms
91,904 KB
testcase_10 AC 226 ms
92,416 KB
testcase_11 AC 235 ms
92,032 KB
testcase_12 AC 191 ms
89,984 KB
testcase_13 AC 218 ms
92,032 KB
testcase_14 AC 151 ms
89,984 KB
testcase_15 AC 198 ms
91,648 KB
testcase_16 AC 232 ms
92,416 KB
testcase_17 AC 232 ms
92,544 KB
testcase_18 AC 244 ms
92,416 KB
testcase_19 AC 203 ms
92,160 KB
testcase_20 AC 161 ms
89,856 KB
testcase_21 AC 215 ms
91,648 KB
testcase_22 AC 236 ms
92,544 KB
testcase_23 AC 222 ms
92,544 KB
testcase_24 AC 201 ms
91,648 KB
testcase_25 AC 222 ms
92,544 KB
testcase_26 AC 211 ms
92,032 KB
testcase_27 AC 225 ms
92,800 KB
testcase_28 AC 200 ms
92,032 KB
testcase_29 AC 223 ms
92,416 KB
testcase_30 AC 39 ms
54,272 KB
testcase_31 AC 39 ms
54,272 KB
testcase_32 AC 217 ms
89,984 KB
testcase_33 AC 249 ms
92,032 KB
testcase_34 AC 219 ms
92,416 KB
testcase_35 AC 40 ms
54,272 KB
testcase_36 AC 38 ms
54,272 KB
testcase_37 AC 40 ms
54,400 KB
testcase_38 AC 40 ms
54,400 KB
testcase_39 AC 43 ms
56,576 KB
testcase_40 AC 43 ms
56,448 KB
testcase_41 AC 62 ms
69,376 KB
testcase_42 AC 68 ms
70,400 KB
testcase_43 AC 69 ms
72,448 KB
testcase_44 AC 65 ms
71,552 KB
testcase_45 AC 51 ms
62,848 KB
testcase_46 AC 92 ms
78,720 KB
testcase_47 AC 100 ms
78,464 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 7)
MAX = 10**5


def main():
    N, K = map(int, input().split())

    solve = [[] for _ in range(11)]
    for i in range(N):
        S, P, U = map(int, input().split())
        solve[S].append((U, P, i))

    selected = [0] * (MAX + 1)
    for team in solve[::-1]:
        if not team:
            continue
        memo = defaultdict(list)
        team.sort()
        for u, p, i in team:
            memo[selected[u]].append((p, i))
            selected[u] += 1

        keys = sorted(memo.keys())
        for key in keys:
            val = sorted(memo[key])
            for _, i in val:
                print(i)
                K -= 1
                if not K:
                    return
    return


main()
0