結果

問題 No.433 ICPC国内予選の選抜ルールがこんな感じだったらうれしい
ユーザー tktk_snsntktk_snsn
提出日時 2021-01-14 01:34:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 345 ms / 4,000 ms
コード長 819 bytes
コンパイル時間 283 ms
コンパイル使用メモリ 87,052 KB
実行使用メモリ 96,244 KB
最終ジャッジ日時 2023-08-14 22:29:35
合計ジャッジ時間 13,848 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 279 ms
91,708 KB
testcase_01 AC 232 ms
91,392 KB
testcase_02 AC 178 ms
90,128 KB
testcase_03 AC 241 ms
91,128 KB
testcase_04 AC 245 ms
91,052 KB
testcase_05 AC 204 ms
90,772 KB
testcase_06 AC 345 ms
96,244 KB
testcase_07 AC 183 ms
90,232 KB
testcase_08 AC 321 ms
95,568 KB
testcase_09 AC 294 ms
94,812 KB
testcase_10 AC 289 ms
94,800 KB
testcase_11 AC 293 ms
94,612 KB
testcase_12 AC 234 ms
90,764 KB
testcase_13 AC 289 ms
94,852 KB
testcase_14 AC 192 ms
90,452 KB
testcase_15 AC 255 ms
95,784 KB
testcase_16 AC 294 ms
95,108 KB
testcase_17 AC 306 ms
94,604 KB
testcase_18 AC 292 ms
95,064 KB
testcase_19 AC 268 ms
94,864 KB
testcase_20 AC 191 ms
90,444 KB
testcase_21 AC 262 ms
95,048 KB
testcase_22 AC 288 ms
94,780 KB
testcase_23 AC 275 ms
94,784 KB
testcase_24 AC 257 ms
94,688 KB
testcase_25 AC 279 ms
94,640 KB
testcase_26 AC 270 ms
95,400 KB
testcase_27 AC 272 ms
95,032 KB
testcase_28 AC 269 ms
94,724 KB
testcase_29 AC 297 ms
95,488 KB
testcase_30 AC 90 ms
72,620 KB
testcase_31 AC 89 ms
72,560 KB
testcase_32 AC 263 ms
91,136 KB
testcase_33 AC 308 ms
94,568 KB
testcase_34 AC 278 ms
94,712 KB
testcase_35 AC 90 ms
72,388 KB
testcase_36 AC 91 ms
72,472 KB
testcase_37 AC 91 ms
72,312 KB
testcase_38 AC 91 ms
72,360 KB
testcase_39 AC 95 ms
73,272 KB
testcase_40 AC 94 ms
72,776 KB
testcase_41 AC 109 ms
78,260 KB
testcase_42 AC 115 ms
78,288 KB
testcase_43 AC 117 ms
78,588 KB
testcase_44 AC 110 ms
78,332 KB
testcase_45 AC 101 ms
77,448 KB
testcase_46 AC 133 ms
78,644 KB
testcase_47 AC 134 ms
78,400 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