結果

問題 No.207 世界のなんとか
ユーザー tanson
提出日時 2025-07-06 01:38:16
言語 Standard ML
(MLton 20210117)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 496 bytes
コンパイル時間 12,327 ms
コンパイル使用メモリ 686,444 KB
実行使用メモリ 7,840 KB
最終ジャッジ日時 2025-07-06 01:38:30
合計ジャッジ時間 5,078 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

fun readInt () =
    valOf (TextIO.scanStream (Int.scan StringCvt.DEC) TextIO.stdIn)

val () =
    let
        val a = readInt ()
        val b = readInt ()
        fun isNumberWith3 n =
            List.exists (fn c => c = #"3") (String.explode (Int.toString n))
        fun printAns n =
            if b < n then ()
            else if n mod 3 = 0 orelse isNumberWith3 n then (print (Int.toString n ^ "\n"); printAns (n + 1))
            else printAns (n + 1)
    in
        printAns a
    end
0