結果

問題 No.211 素数サイコロと合成数サイコロ (1)
コンテスト
ユーザー neko_the_shadow
提出日時 2018-12-05 23:36:49
言語 Scala(Beta)
(3.8.1)
コンパイル:
scalac _filename_
実行:
java -cp .:/home/linuxbrew/.linuxbrew/Cellar/scala/3.8.1/libexec/maven2/org/scala-lang/scala3-library_3/3.8.1/scala3-library_3-3.8.1.jar:/home/linuxbrew/.linuxbrew/Cellar/scala/3.8.1/libexec/maven2/org/scala-lang/scala-library/3.8.1/scala-library-3.8.1.jar _class_
結果
AC  
実行時間 349 ms / 1,000 ms
コード長 323 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 9,784 ms
コンパイル使用メモリ 266,536 KB
実行使用メモリ 54,848 KB
最終ジャッジ日時 2026-03-09 16:30:17
合計ジャッジ時間 22,684 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

object Q211 {
  def main(args: Array[String]): Unit = {
    val k = io.StdIn.readLine().toInt

    val primes = Seq(2, 3, 5, 7, 11, 13)
    val composites = Seq(4, 6, 8, 9, 10, 12)
    val numer = (for (prime <- primes; composite <- composites) yield prime * composite).count(_ == k)
    println(numer.toDouble / 36)
  }
}
0