Submission #154966


Source Code Expand

let ( |> ) x f = f x

module String = struct
  include String
  let to_list s = 
    let rec to_list_aux acc = function
      | 0 -> acc
      | n -> to_list_aux (s.[n - 1] :: acc) (n - 1) in
    to_list_aux [] (String.length s)
end

let () = 
  let n = read_int () in
  string_of_int n
    |> String.to_list
    |> List.map (( = ) '3')
    |> List.fold_left ( || ) false
    |> ( || ) (n mod 3 = 0)
    |> (function true -> "YES" | false -> "NO")
    |> print_endline

Submission Info

Submission Time
Task A - 世界のFizzBuzz
User fetburner
Language OCaml (3.12.1)
Score 100
Code Size 487 Byte
Status AC
Exec Time 31 ms
Memory 1172 KB

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 9
Set Name Test Cases
All test_1.txt, test_2.txt, test_3.txt, test_4.txt, test_5.txt, test_6.txt, test_7.txt, test_8.txt, test_9.txt
Case Name Status Exec Time Memory
sample_01.txt AC 29 ms 1056 KB
sample_02.txt AC 28 ms 1060 KB
sample_03.txt AC 24 ms 1172 KB
test_1.txt AC 26 ms 1048 KB
test_2.txt AC 25 ms 1056 KB
test_3.txt AC 26 ms 1056 KB
test_4.txt AC 27 ms 1064 KB
test_5.txt AC 26 ms 1060 KB
test_6.txt AC 27 ms 1060 KB
test_7.txt AC 31 ms 1000 KB
test_8.txt AC 26 ms 988 KB
test_9.txt AC 26 ms 988 KB