結果

問題 No.211 素数サイコロと合成数サイコロ (1)
ユーザー gemmarogemmaro
提出日時 2020-04-19 08:20:36
言語 Elixir
(1.16.2)
結果
AC  
実行時間 661 ms / 1,000 ms
コード長 300 bytes
コンパイル時間 1,049 ms
コンパイル使用メモリ 54,720 KB
実行使用メモリ 51,112 KB
最終ジャッジ日時 2023-08-30 00:26:10
合計ジャッジ時間 24,716 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 644 ms
49,480 KB
testcase_01 AC 648 ms
49,264 KB
testcase_02 AC 643 ms
49,176 KB
testcase_03 AC 651 ms
49,872 KB
testcase_04 AC 643 ms
49,384 KB
testcase_05 AC 647 ms
49,892 KB
testcase_06 AC 649 ms
49,140 KB
testcase_07 AC 646 ms
49,224 KB
testcase_08 AC 646 ms
49,180 KB
testcase_09 AC 647 ms
49,420 KB
testcase_10 AC 650 ms
49,276 KB
testcase_11 AC 648 ms
50,004 KB
testcase_12 AC 650 ms
49,928 KB
testcase_13 AC 661 ms
49,332 KB
testcase_14 AC 647 ms
49,188 KB
testcase_15 AC 635 ms
51,112 KB
testcase_16 AC 637 ms
50,084 KB
testcase_17 AC 639 ms
49,220 KB
testcase_18 AC 638 ms
49,796 KB
testcase_19 AC 637 ms
49,356 KB
testcase_20 AC 638 ms
49,296 KB
testcase_21 AC 648 ms
49,808 KB
testcase_22 AC 642 ms
49,432 KB
testcase_23 AC 643 ms
49,956 KB
testcase_24 AC 637 ms
49,696 KB
testcase_25 AC 640 ms
49,272 KB
testcase_26 AC 636 ms
49,156 KB
testcase_27 AC 640 ms
49,876 KB
testcase_28 AC 635 ms
49,388 KB
testcase_29 AC 643 ms
49,932 KB
testcase_30 AC 635 ms
49,148 KB
testcase_31 AC 639 ms
49,824 KB
testcase_32 AC 641 ms
49,116 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

defmodule Main do
  def main do
    IO.read(:line)
    |> String.trim()
    |> String.to_integer()
    |> solve
    |> IO.puts()
  end

  def solve(k) do
    [2, 3, 5, 7, 11, 13]
    |> Enum.count(fn p -> k |> rem(p) == 0 && (k |> div(p)) in [4, 6, 8, 9, 10, 12] end)
    |> (&(&1 / 36)).()
  end
end
0