結果
| 問題 |
No.475 最終日 - Writerの怠慢
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-12-11 15:16:22 |
| 言語 | D (dmd 2.109.1) |
| 結果 |
AC
|
| 実行時間 | 29 ms / 2,000 ms |
| コード長 | 594 bytes |
| コンパイル時間 | 2,479 ms |
| コンパイル使用メモリ | 158,340 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-12 22:59:22 |
| 合計ジャッジ時間 | 3,403 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 15 |
ソースコード
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;
}
ans *= (r-i).to!real / (n-i-1);
}
writefln("%.10f", ans);
}