結果
問題 | No.207 世界のなんとか |
ユーザー |
|
提出日時 | 2017-05-05 18:45:58 |
言語 | OCaml (5.2.1) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 495 bytes |
コンパイル時間 | 430 ms |
コンパイル使用メモリ | 21,448 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-08 23:59:52 |
合計ジャッジ時間 | 1,186 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 |
ソースコード
let solve a b =let rec has3 num =if num = 0 thenfalseelse (let dig1 = num mod 10 inif dig1 = 3 || dig1 = -3 thentrueelsehas3 (num / 10))inlet rec solve' i =if i > b then()else (if i mod 3 = 0 || has3 i thenprint_endline (string_of_int i);solve' (i + 1))insolve' alet () =let a, b = read_line ()|> fun l -> Scanf.sscanf l "%d %d" (fun a b -> (a, b))insolve a b