結果

問題 No.433 ICPC国内予選の選抜ルールがこんな感じだったらうれしい
ユーザー roiti46roiti46
提出日時 2016-10-14 22:59:50
言語 Python2
(2.7.18)
結果
AC  
実行時間 874 ms / 4,000 ms
コード長 516 bytes
コンパイル時間 796 ms
コンパイル使用メモリ 7,052 KB
実行使用メモリ 44,700 KB
最終ジャッジ日時 2023-08-14 12:00:54
合計ジャッジ時間 31,826 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 851 ms
44,588 KB
testcase_01 AC 861 ms
44,552 KB
testcase_02 AC 838 ms
44,232 KB
testcase_03 AC 871 ms
44,676 KB
testcase_04 AC 859 ms
44,492 KB
testcase_05 AC 857 ms
44,656 KB
testcase_06 AC 849 ms
44,700 KB
testcase_07 AC 851 ms
44,284 KB
testcase_08 AC 834 ms
44,384 KB
testcase_09 AC 838 ms
44,368 KB
testcase_10 AC 829 ms
41,192 KB
testcase_11 AC 832 ms
41,456 KB
testcase_12 AC 855 ms
41,784 KB
testcase_13 AC 828 ms
41,116 KB
testcase_14 AC 838 ms
41,520 KB
testcase_15 AC 792 ms
41,344 KB
testcase_16 AC 832 ms
41,444 KB
testcase_17 AC 857 ms
41,596 KB
testcase_18 AC 846 ms
41,444 KB
testcase_19 AC 821 ms
41,220 KB
testcase_20 AC 849 ms
41,464 KB
testcase_21 AC 830 ms
41,204 KB
testcase_22 AC 845 ms
41,592 KB
testcase_23 AC 821 ms
41,168 KB
testcase_24 AC 816 ms
41,156 KB
testcase_25 AC 831 ms
41,168 KB
testcase_26 AC 815 ms
41,256 KB
testcase_27 AC 825 ms
41,192 KB
testcase_28 AC 808 ms
41,120 KB
testcase_29 AC 833 ms
41,440 KB
testcase_30 AC 24 ms
8,632 KB
testcase_31 AC 25 ms
8,624 KB
testcase_32 AC 874 ms
42,296 KB
testcase_33 AC 854 ms
42,452 KB
testcase_34 AC 821 ms
44,252 KB
testcase_35 AC 24 ms
8,464 KB
testcase_36 AC 24 ms
8,668 KB
testcase_37 AC 26 ms
8,648 KB
testcase_38 AC 25 ms
8,480 KB
testcase_39 AC 30 ms
8,900 KB
testcase_40 AC 30 ms
8,892 KB
testcase_41 AC 84 ms
11,792 KB
testcase_42 AC 81 ms
11,664 KB
testcase_43 AC 79 ms
11,504 KB
testcase_44 AC 80 ms
11,956 KB
testcase_45 AC 31 ms
8,788 KB
testcase_46 AC 90 ms
11,716 KB
testcase_47 AC 88 ms
11,708 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-
import sys,copy,math,heapq,itertools as it,fractions,re,bisect,collections as coll
import heapq

N, K = map(int, raw_input().split())
SPU = [map(int, raw_input().split()) for i in xrange(N)]
SPU = [[S, P, U, i] for i, (S, P, U) in enumerate(SPU)]
SPU.sort(key = lambda x: x[1])
SPU.sort(key = lambda x: -x[0])

C = [0]*100005
ans = []
for S, P, U, i in SPU:
    ans.append([10**18*(S + 1) - C[U]*10**8 + 10**7 - P, i])
    C[U] += 1
ans.sort(reverse = True)

for _, i in ans[:K]:
    print i
0