結果

問題 No.311 z in FizzBuzzString
コンテスト
ユーザー ichibanshibori
提出日時 2016-10-09 00:18:37
言語 OCaml
(5.4.1)
コンパイル:
ocamlfind ocamlopt -linkpkg -package zarith,str _filename_ -o a.out
実行:
./a.out
結果
AC  
実行時間 1 ms / 1,500 ms
コード長 380 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,126 ms
コンパイル使用メモリ 21,384 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-04-12 01:13:44
合計ジャッジ時間 1,852 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

let ( +@ ) = Int64.add
let ( -@ ) = Int64.sub
let ( *@ ) = Int64.mul
let ( /@ ) = Int64.div

let () =
  let n = read_line () |> Int64.of_string in
  let fb = n /@ (Int64.of_int 15) in
  let f = (n /@ (Int64.of_int 3)) -@ fb
  and b = (n /@ (Int64.of_int 5)) -@ fb
  in
  let ans = (fb *@ (Int64.of_int 4)) +@ ((f +@ b) *@ (Int64.of_int 2)) in
  print_endline (Int64.to_string ans)
0