結果
問題 |
No.311 z in FizzBuzzString
|
ユーザー |
![]() |
提出日時 | 2018-04-14 13:57:27 |
言語 | F# (F# 4.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 332 bytes |
コンパイル時間 | 12,283 ms |
コンパイル使用メモリ | 188,028 KB |
実行使用メモリ | 39,308 KB |
最終ジャッジ日時 | 2024-09-24 22:07:17 |
合計ジャッジ時間 | 14,383 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 7 RE * 4 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (312 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/
ソースコード
let (|FizzAndBuzz|FizzOrBuzz|Other|) n = match n%3,n%5 with | 0,0 -> FizzAndBuzz | 0,_ | _,0 -> FizzOrBuzz | _ -> Other let fizzBuzzStr = function | FizzAndBuzz -> 4 | FizzOrBuzz -> 2 | Other -> 0 let N = stdin.ReadLine() |> int [1..N] |> List.sumBy(fizzBuzzStr) |> printfn "%i"