結果

問題 No.311 z in FizzBuzzString
ユーザー ToniTakekawa
提出日時 2016-03-20 01:05:54
言語 F#
(F# 4.0)
結果
RE  
実行時間 -
コード長 295 bytes
コンパイル時間 6,676 ms
コンパイル使用メモリ 190,668 KB
実行使用メモリ 37,248 KB
最終ジャッジ日時 2024-09-24 21:37:04
合計ジャッジ時間 10,956 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 7 RE * 4
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (229 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