結果

問題 No.311 z in FizzBuzzString
ユーザー ToniTakekawa
提出日時 2016-03-20 01:05:19
言語 F#
(F# 4.0)
結果
RE  
実行時間 -
コード長 295 bytes
コンパイル時間 7,331 ms
コンパイル使用メモリ 190,744 KB
実行使用メモリ 37,504 KB
最終ジャッジ日時 2024-09-24 21:36:45
合計ジャッジ時間 11,670 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 7 RE * 4
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (223 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

open System

let zCount = function
    | x when x % 15 = 0 -> 4
    | x when x %  3 = 0 -> 2
    | x when x %  5 = 0 -> 2
    | x                 -> 0

let count = int(Console.ReadLine())
let n = Seq.initInfinite (fun i->i+1)
let z = Seq.map zCount n |> Seq.take count |> Seq.sum

printfn "%d" z
0