結果
問題 | No.133 カードゲーム |
ユーザー |
|
提出日時 | 2016-08-30 23:31:30 |
言語 | D (dmd 2.109.1) |
結果 |
AC
|
実行時間 | 331 ms / 5,000 ms |
コード長 | 537 bytes |
コンパイル時間 | 2,377 ms |
コンパイル使用メモリ | 165,480 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-12 03:55:01 |
合計ジャッジ時間 | 9,737 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 19 |
ソースコード
import std.algorithm, std.array, std.container, std.range;import std.string, std.conv;import std.math, std.bigint, std.bitmanip, std.random;import std.stdio, std.typecons;const auto repeat = 10 ^^ 6;void main(){auto n = readln.chomp.to!int;auto ai = readln.split.map!(to!int).array;auto bi = readln.split.map!(to!int).array;auto r = 0;foreach (_; 0..repeat) {ai.randomShuffle;bi.randomShuffle;if (ai.zip(bi).count!("a[0] > a[1]") > n / 2)r += 1;}writefln("%f", r.to!real / repeat);}