結果

問題 No.311 z in FizzBuzzString
ユーザー chike_pluschike_plus
提出日時 2019-03-27 07:30:12
言語 F#
(F# 4.0)
結果
RE  
実行時間 -
コード長 463 bytes
コンパイル時間 6,605 ms
コンパイル使用メモリ 190,456 KB
実行使用メモリ 40,460 KB
最終ジャッジ日時 2023-10-25 02:57:39
合計ジャッジ時間 8,864 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
31,476 KB
testcase_01 AC 65 ms
31,496 KB
testcase_02 AC 64 ms
31,496 KB
testcase_03 AC 63 ms
31,496 KB
testcase_04 AC 64 ms
31,496 KB
testcase_05 AC 64 ms
31,536 KB
testcase_06 AC 63 ms
31,552 KB
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (226 ms)。
MSBuild のバージョン 17.7.3+8ec440e68 (.NET)
  main -> /home/judge/data/code/bin/Release/net7.0/main.dll
  main -> /home/judge/data/code/bin/Release/net7.0/publish/

ソースコード

diff #

let ``No.311 z in FizzBuzzString``() =

  let (|Fizz|Buzz|FizzBuzz|Other|) arg =
    match (arg%3) , (arg%5) with
    | 0 , 0 -> FizzBuzz
    | 0 , _ -> Fizz
    | _ , 0 -> Buzz
    | _ , _ -> Other

  stdin.ReadLine()
  |> int
  |> fun n ->
    [1..n]
    |> List.sumBy (fun i ->
      match i with
      | FizzBuzz  -> 4
      | Fizz      -> 2
      | Buzz      -> 2
      | Other     -> 0
    )
    |> stdout.WriteLine    
    
``No.311 z in FizzBuzzString``()
0