結果

問題 No.120 傾向と対策:門松列(その1)
ユーザー diginatudiginatu
提出日時 2015-01-08 23:52:56
言語 D
(dmd 2.107.1)
結果
WA  
実行時間 -
コード長 550 bytes
コンパイル時間 1,062 ms
コンパイル使用メモリ 109,792 KB
実行使用メモリ 4,496 KB
最終ジャッジ日時 2023-09-02 19:35:36
合計ジャッジ時間 1,683 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

void main(){
  auto T = readln().strip().to!int();

  foreach(immutable i; 0 .. T) {
    auto N = readln().strip().to!int();
    auto L = readln().strip().split().map!(to!int)().array;

    int bef = -1;
    int t = 1;

    L.sort();
    auto tps = L.group().array();
    tps.sort!"a[1] > b[1]";

    int[] kadomatsu;
    kadomatsu.length = 3;

    foreach(tp; tps) {
      kadomatsu.minPos[0] += tp[1];
    }

    writeln(kadomatsu.reduce!min());
  }

}
0