結果
| 問題 | No.133 カードゲーム |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-01-31 14:49:51 |
| 言語 | D (dmd 2.112.0) |
| 結果 |
AC
|
| 実行時間 | 0 ms / 5,000 ms |
| + 977µs | |
| コード長 | 352 bytes |
| 記録 | |
| コンパイル時間 | 1,370 ms |
| コンパイル使用メモリ | 137,472 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-26 01:16:26 |
| 合計ジャッジ時間 | 2,811 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 19 |
ソースコード
import std.algorithm, std.conv, std.range, std.stdio, std.string;
void main()
{
auto n = readln.chomp.to!size_t;
auto ai = readln.split.to!(int[]);
auto bi = readln.split.to!(int[]);
auto c = bi.permutations.count!(ci => zip(ai, ci).count!"a[0] > a[1]" > n / 2);
writefln("%.3f", c.to!real / n.to!int.iota.map!"a + 1".fold!("a * b")(1));
}