結果

問題 No.433 ICPC国内予選の選抜ルールがこんな感じだったらうれしい
ユーザー te-shte-sh
提出日時 2017-10-30 11:17:37
言語 D
(dmd 2.107.1)
結果
AC  
実行時間 115 ms / 4,000 ms
コード長 719 bytes
コンパイル時間 951 ms
コンパイル使用メモリ 119,732 KB
実行使用メモリ 10,108 KB
最終ジャッジ日時 2023-09-03 16:35:43
合計ジャッジ時間 8,320 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
9,636 KB
testcase_01 AC 107 ms
9,160 KB
testcase_02 AC 95 ms
10,108 KB
testcase_03 AC 96 ms
8,852 KB
testcase_04 AC 95 ms
9,380 KB
testcase_05 AC 99 ms
9,896 KB
testcase_06 AC 115 ms
8,652 KB
testcase_07 AC 102 ms
8,608 KB
testcase_08 AC 97 ms
9,100 KB
testcase_09 AC 87 ms
9,636 KB
testcase_10 AC 83 ms
9,320 KB
testcase_11 AC 86 ms
8,664 KB
testcase_12 AC 87 ms
9,588 KB
testcase_13 AC 76 ms
9,116 KB
testcase_14 AC 78 ms
9,900 KB
testcase_15 AC 73 ms
9,332 KB
testcase_16 AC 87 ms
9,880 KB
testcase_17 AC 91 ms
8,812 KB
testcase_18 AC 89 ms
9,396 KB
testcase_19 AC 76 ms
9,892 KB
testcase_20 AC 81 ms
8,832 KB
testcase_21 AC 81 ms
9,588 KB
testcase_22 AC 84 ms
9,120 KB
testcase_23 AC 80 ms
8,896 KB
testcase_24 AC 80 ms
10,016 KB
testcase_25 AC 84 ms
9,428 KB
testcase_26 AC 75 ms
9,096 KB
testcase_27 AC 81 ms
9,116 KB
testcase_28 AC 78 ms
8,828 KB
testcase_29 AC 82 ms
9,596 KB
testcase_30 AC 1 ms
4,380 KB
testcase_31 AC 1 ms
4,380 KB
testcase_32 AC 90 ms
8,648 KB
testcase_33 AC 95 ms
8,652 KB
testcase_34 AC 90 ms
9,588 KB
testcase_35 AC 2 ms
4,380 KB
testcase_36 AC 1 ms
4,376 KB
testcase_37 AC 1 ms
4,376 KB
testcase_38 AC 2 ms
4,380 KB
testcase_39 AC 2 ms
4,376 KB
testcase_40 AC 2 ms
4,376 KB
testcase_41 AC 8 ms
4,380 KB
testcase_42 AC 8 ms
4,376 KB
testcase_43 AC 8 ms
4,376 KB
testcase_44 AC 8 ms
4,376 KB
testcase_45 AC 2 ms
4,500 KB
testcase_46 AC 10 ms
4,376 KB
testcase_47 AC 11 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import std.algorithm, std.conv, std.range, std.stdio, std.string;

void main()
{
  auto rd = readln.split.to!(size_t[]), n = rd[0], k = rd[1];

  struct Score { size_t i; int s, p, u; size_t ui; }
  auto scores = new Score*[](n);

  foreach (i; 0..n) {
    auto rd2 = readln.splitter;
    auto s = rd2.front.to!int; rd2.popFront();
    auto p = rd2.front.to!int; rd2.popFront();
    auto u = rd2.front.to!int;
    scores[i] = new Score(i, s, p, u);
  }

  scores.multiSort!("a.u < b.u", "a.s > b.s", "a.p < b.p");
  foreach (g; scores.chunkBy!"a.u == b.u")
    foreach (i, gi; g.enumerate)
      gi.ui = i;

  scores.multiSort!("a.s > b.s", "a.ui < b.ui", "a.p < b.p");

  foreach (i; 0..k)
    writeln(scores[i].i);
}
0