結果

問題 No.433 ICPC国内予選の選抜ルールがこんな感じだったらうれしい
ユーザー tubo28tubo28
提出日時 2016-10-15 00:45:29
言語 Ruby
(3.3.0)
結果
AC  
実行時間 1,489 ms / 4,000 ms
コード長 275 bytes
コンパイル時間 135 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 33,664 KB
最終ジャッジ日時 2024-05-02 00:53:01
合計ジャッジ時間 52,324 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,405 ms
32,640 KB
testcase_01 AC 1,396 ms
32,896 KB
testcase_02 AC 1,388 ms
31,488 KB
testcase_03 AC 1,404 ms
32,000 KB
testcase_04 AC 1,405 ms
32,000 KB
testcase_05 AC 1,398 ms
32,384 KB
testcase_06 AC 1,489 ms
33,664 KB
testcase_07 AC 1,364 ms
32,768 KB
testcase_08 AC 1,423 ms
32,768 KB
testcase_09 AC 1,444 ms
32,256 KB
testcase_10 AC 1,386 ms
32,000 KB
testcase_11 AC 1,442 ms
32,000 KB
testcase_12 AC 1,415 ms
32,000 KB
testcase_13 AC 1,401 ms
32,000 KB
testcase_14 AC 1,360 ms
32,000 KB
testcase_15 AC 1,323 ms
32,000 KB
testcase_16 AC 1,390 ms
32,000 KB
testcase_17 AC 1,419 ms
32,000 KB
testcase_18 AC 1,423 ms
31,872 KB
testcase_19 AC 1,387 ms
31,872 KB
testcase_20 AC 1,388 ms
31,872 KB
testcase_21 AC 1,410 ms
32,000 KB
testcase_22 AC 1,415 ms
31,872 KB
testcase_23 AC 1,412 ms
32,000 KB
testcase_24 AC 1,408 ms
31,744 KB
testcase_25 AC 1,419 ms
32,000 KB
testcase_26 AC 1,350 ms
31,872 KB
testcase_27 AC 1,373 ms
32,000 KB
testcase_28 AC 1,429 ms
32,000 KB
testcase_29 AC 1,371 ms
32,000 KB
testcase_30 AC 95 ms
12,160 KB
testcase_31 AC 96 ms
12,160 KB
testcase_32 AC 1,422 ms
31,872 KB
testcase_33 AC 1,465 ms
31,872 KB
testcase_34 AC 1,461 ms
32,256 KB
testcase_35 AC 90 ms
12,160 KB
testcase_36 AC 94 ms
12,288 KB
testcase_37 AC 95 ms
12,288 KB
testcase_38 AC 93 ms
12,288 KB
testcase_39 AC 104 ms
12,288 KB
testcase_40 AC 102 ms
12,288 KB
testcase_41 AC 197 ms
13,952 KB
testcase_42 AC 196 ms
13,824 KB
testcase_43 AC 181 ms
14,080 KB
testcase_44 AC 183 ms
14,080 KB
testcase_45 AC 105 ms
12,416 KB
testcase_46 AC 207 ms
14,080 KB
testcase_47 AC 212 ms
13,952 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n,k = gets.split.map(&:to_i)
s,p,u = readlines.map { |l| l.split.map(&:to_i) }.transpose

r = Array.new(n)
cnt = {}
cnt.default = 0
puts (0...n).sort_by { |i| [-s[i],p[i]] }.each { |i|
    r[i] = cnt[u[i]]
    cnt[u[i]] += 1
}.sort_by { |i|
    [-s[i], r[i], p[i]]
}.first(k)
0