結果

問題 No.311 z in FizzBuzzString
コンテスト
ユーザー ichibanshibori
提出日時 2016-10-09 00:18:37
言語 OCaml
(5.5.0)
コンパイル:
ocamlfind ocamlopt -linkpkg -package zarith,str _filename_ -o a.out
実行:
./a.out
結果
AC  
実行時間 1 ms / 1,500 ms
+ 441µs
コード長 380 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,720 ms
コンパイル使用メモリ 21,144 KB
実行使用メモリ 9,796 KB
最終ジャッジ日時 2026-09-03 12:53:31
合計ジャッジ時間 3,040 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11
権限があれば一括ダウンロードができます
コンパイルメッセージ
ocamlfind: [WARNING] Cannot read directory ./stublibs which is mentioned in ld.conf

ソースコード

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