結果

問題 No.211 素数サイコロと合成数サイコロ (1)
ユーザー te-sh
提出日時 2017-05-15 17:22:38
言語 D
(dmd 2.109.1)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 305 bytes
コンパイル時間 2,675 ms
コンパイル使用メモリ 149,132 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-12 19:15:30
合計ジャッジ時間 3,447 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

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

// allowable-error: 10 ** -12

const di1 = [2,3,5,7,11,13];
const di2 = [4,6,8,9,10,12];

void main()
{
  auto k = readln.chomp.to!int;
  auto c = di1.map!(d1 => di2.count!(d2 => d1 * d2 == k)).sum;
  writefln("%.13f", c.to!real / 36);
}
0