結果

問題 No.637 X: Yet Another FizzBuzz Problem
ユーザー taktak
提出日時 2018-03-26 23:58:27
言語 F#
(F# 4.0)
結果
AC  
実行時間 88 ms / 1,000 ms
コード長 366 bytes
コンパイル時間 5,450 ms
コンパイル使用メモリ 161,332 KB
実行使用メモリ 24,904 KB
最終ジャッジ日時 2023-09-11 04:35:20
合計ジャッジ時間 8,854 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
22,876 KB
testcase_01 AC 87 ms
22,848 KB
testcase_02 AC 87 ms
24,900 KB
testcase_03 AC 86 ms
24,856 KB
testcase_04 AC 87 ms
22,824 KB
testcase_05 AC 86 ms
24,828 KB
testcase_06 AC 87 ms
22,824 KB
testcase_07 AC 85 ms
22,880 KB
testcase_08 AC 85 ms
24,848 KB
testcase_09 AC 84 ms
22,808 KB
testcase_10 AC 86 ms
24,868 KB
testcase_11 AC 86 ms
22,832 KB
testcase_12 AC 84 ms
24,768 KB
testcase_13 AC 85 ms
22,876 KB
testcase_14 AC 85 ms
22,752 KB
testcase_15 AC 86 ms
24,852 KB
testcase_16 AC 86 ms
22,892 KB
testcase_17 AC 86 ms
22,960 KB
testcase_18 AC 86 ms
22,888 KB
testcase_19 AC 86 ms
22,972 KB
testcase_20 AC 85 ms
20,868 KB
testcase_21 AC 86 ms
22,824 KB
testcase_22 AC 86 ms
22,892 KB
testcase_23 AC 85 ms
24,904 KB
testcase_24 AC 86 ms
24,900 KB
testcase_25 AC 84 ms
22,828 KB
testcase_26 AC 84 ms
22,856 KB
testcase_27 AC 85 ms
22,916 KB
testcase_28 AC 85 ms
24,884 KB
testcase_29 AC 86 ms
24,804 KB
testcase_30 AC 86 ms
24,888 KB
testcase_31 AC 88 ms
22,872 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

open System

let (|FizzBuzz|Fizz|Buzz|Num|) n =
  match n%3,n%5 with
  | 0,0 -> FizzBuzz
  | 0,_ -> Fizz
  | _,0 -> Buzz
  | _   -> Num n
  
let strLen x =
  match x with
  | FizzBuzz    -> 8
  | Fizz | Buzz -> 4
  | Num n       -> n.ToString().Length
  
Console.ReadLine().Split() 
|> Array.map (int)  
|> Array.fold (fun acc x -> acc + strLen(x)) 0
|> printfn "%i"
0