結果

問題 No.475 最終日 - Writerの怠慢
ユーザー te-shte-sh
提出日時 2017-12-11 15:16:06
言語 D
(dmd 2.106.1)
結果
WA  
実行時間 -
コード長 610 bytes
コンパイル時間 2,635 ms
コンパイル使用メモリ 156,768 KB
実行使用メモリ 6,860 KB
最終ジャッジ日時 2023-09-03 17:26:20
合計ジャッジ時間 4,382 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

void main()
{
  auto rd = readln.split.to!(int[]), n = rd[0], s = rd[1], w = rd[2];
  auto a = readln.split.to!(int[]);

  auto aw = a[w] + 100*s;
  a = a.remove(w).array;
  a.sort!"a > b";

  auto st = new int[](n-1);
  foreach (i; 0..n-1) st[i] = 50*s + 500*s/(8+2*(i+1));
  st.reverse();

  auto ans = 1.0L;
  foreach (i; 0..n-1) {
    auto r = st.assumeSorted!"a <= b".lowerBound(aw - a[i]).length;
    if (r < i) {
      writeln(0);
      return;
    }
    writeln(r);
    ans *= (r-i).to!real / (n-i-1);
  }

  writefln("%.10f", ans);
}
0