結果

問題 No.207 世界のなんとか
ユーザー i524i524
提出日時 2020-08-12 16:52:27
言語 Scala(Beta)
(3.4.0)
結果
AC  
実行時間 936 ms / 5,000 ms
コード長 448 bytes
コンパイル時間 8,528 ms
コンパイル使用メモリ 266,204 KB
実行使用メモリ 63,488 KB
最終ジャッジ日時 2024-04-18 00:46:10
合計ジャッジ時間 26,466 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 906 ms
63,100 KB
testcase_01 AC 936 ms
63,304 KB
testcase_02 AC 908 ms
63,424 KB
testcase_03 AC 859 ms
63,484 KB
testcase_04 AC 857 ms
63,468 KB
testcase_05 AC 838 ms
63,480 KB
testcase_06 AC 858 ms
63,240 KB
testcase_07 AC 856 ms
63,212 KB
testcase_08 AC 843 ms
63,204 KB
testcase_09 AC 872 ms
63,376 KB
testcase_10 AC 870 ms
63,440 KB
testcase_11 AC 857 ms
63,488 KB
testcase_12 AC 861 ms
63,448 KB
testcase_13 AC 867 ms
63,252 KB
testcase_14 AC 838 ms
63,208 KB
testcase_15 AC 841 ms
63,316 KB
testcase_16 AC 832 ms
63,260 KB
testcase_17 AC 878 ms
63,168 KB
testcase_18 AC 884 ms
63,144 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import scala.io.StdIn.readLine

object Nabeatsu {
  def divisibleByThree = (_: Int) % 3 == 0
  def containsThree(x: Int): Boolean = x match {
    case x if x > 10 => x % 10 == 3 || containsThree(x / 10)
    case 3 => true
    case _ => false
  }

  def main(args: Array[String]): Unit = {
    val arr = readLine().split(" ").map(_.toInt)
    (arr(0) to arr(1)).filter(v => divisibleByThree(v) || containsThree(v)).foreach(System.out.println)
  }
}
0