結果

問題 No.211 素数サイコロと合成数サイコロ (1)
コンテスト
ユーザー xsd
提出日時 2020-06-14 23:59:46
言語 OCaml
(5.4.1)
コンパイル:
ocamlfind ocamlopt -linkpkg -package zarith,str _filename_ -o a.out
実行:
./a.out
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 298 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 284 ms
コンパイル使用メモリ 22,792 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-04-25 05:00:14
合計ジャッジ時間 1,431 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

Scanf.scanf "%d" (fun k ->
    let arr = Array.make 201 0 in
    Array.iter (fun a ->
        Array.iter (fun b ->
            let c = a * b in
            arr.(c) <- arr.(c) + 1
        ) [| 4; 6; 8; 9; 10; 12 |]
    ) [| 2; 3; 5; 7; 11; 13 |];
    Printf.printf "%.12f\n" (float arr.(k) /. 36.)
)
0