結果

問題 No.211 素数サイコロと合成数サイコロ (1)
ユーザー norioc
提出日時 2017-08-17 00:47:26
言語 D
(dmd 2.109.1)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 522 bytes
コンパイル時間 2,392 ms
コンパイル使用メモリ 151,884 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-12 21:34:41
合計ジャッジ時間 3,599 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

int readint() {
    return readln.chomp.to!int;
}

int[] readints() {
    return readln.split.map!(to!int).array;
}

void main() {
    int k = readint();

    int n = 0;
    foreach (a; [2, 3, 5, 7, 11, 13]) {
        foreach (b; [4, 6, 8, 9, 10, 12]) {
            if (a * b == k) {
                n++;
            }
        }
    }

    writefln("%.12f", n / 36.0);
}
0