結果

問題 No.433 ICPC国内予選の選抜ルールがこんな感じだったらうれしい
ユーザー chocoruskchocorusk
提出日時 2020-09-27 00:49:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 520 ms / 4,000 ms
コード長 540 bytes
コンパイル時間 1,686 ms
コンパイル使用メモリ 86,868 KB
実行使用メモリ 132,440 KB
最終ジャッジ日時 2023-09-12 13:23:49
合計ジャッジ時間 21,315 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 511 ms
131,732 KB
testcase_01 AC 475 ms
132,440 KB
testcase_02 AC 451 ms
132,188 KB
testcase_03 AC 417 ms
132,160 KB
testcase_04 AC 432 ms
132,036 KB
testcase_05 AC 443 ms
132,196 KB
testcase_06 AC 520 ms
132,216 KB
testcase_07 AC 474 ms
132,352 KB
testcase_08 AC 491 ms
132,392 KB
testcase_09 AC 444 ms
131,948 KB
testcase_10 AC 468 ms
131,288 KB
testcase_11 AC 471 ms
131,344 KB
testcase_12 AC 462 ms
131,376 KB
testcase_13 AC 458 ms
131,308 KB
testcase_14 AC 461 ms
131,324 KB
testcase_15 AC 474 ms
131,420 KB
testcase_16 AC 468 ms
131,384 KB
testcase_17 AC 467 ms
131,340 KB
testcase_18 AC 459 ms
131,292 KB
testcase_19 AC 461 ms
131,328 KB
testcase_20 AC 450 ms
131,312 KB
testcase_21 AC 458 ms
131,296 KB
testcase_22 AC 456 ms
131,260 KB
testcase_23 AC 450 ms
131,424 KB
testcase_24 AC 448 ms
131,544 KB
testcase_25 AC 464 ms
131,280 KB
testcase_26 AC 464 ms
131,100 KB
testcase_27 AC 469 ms
131,044 KB
testcase_28 AC 453 ms
131,288 KB
testcase_29 AC 470 ms
131,080 KB
testcase_30 AC 82 ms
76,668 KB
testcase_31 AC 79 ms
76,668 KB
testcase_32 AC 462 ms
131,608 KB
testcase_33 AC 471 ms
131,652 KB
testcase_34 AC 419 ms
132,100 KB
testcase_35 AC 76 ms
76,800 KB
testcase_36 AC 76 ms
76,544 KB
testcase_37 AC 77 ms
76,720 KB
testcase_38 AC 77 ms
76,488 KB
testcase_39 AC 85 ms
77,448 KB
testcase_40 AC 83 ms
77,184 KB
testcase_41 AC 113 ms
79,888 KB
testcase_42 AC 125 ms
85,048 KB
testcase_43 AC 112 ms
79,656 KB
testcase_44 AC 110 ms
79,772 KB
testcase_45 AC 89 ms
77,112 KB
testcase_46 AC 125 ms
85,720 KB
testcase_47 AC 125 ms
85,636 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
read=sys.stdin.buffer.read
readline=sys.stdin.buffer.readline
readlines=sys.stdin.buffer.readlines

n, k=map(int, readline().split())
spu=list(map(int, read().split()))
s=spu[::3]
p=spu[1::3]
u=spu[2::3]
num=[0]*n
v=[[] for _ in range(100001)]
for i, x in enumerate(u):
    v[x].append(i)
for x in range(100001):
    if v[x]:
        v[x].sort(key=lambda i: -s[i]*(10**7)+p[i])
        for j, i in enumerate(v[x]):
            num[i]=j
q=[(-s[i], num[i], p[i], i) for i in range(n)]
q.sort()
for i in range(k):
    print(q[i][3])
0