結果

問題 No.316 もっと刺激的なFizzBuzzをください
ユーザー taktak
提出日時 2019-06-26 01:09:13
言語 F#
(F# 4.0)
結果
AC  
実行時間 61 ms / 1,000 ms
コード長 632 bytes
コンパイル時間 4,713 ms
コンパイル使用メモリ 162,772 KB
実行使用メモリ 24,200 KB
最終ジャッジ日時 2023-09-05 19:26:20
合計ジャッジ時間 7,223 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
22,136 KB
testcase_01 AC 59 ms
22,200 KB
testcase_02 AC 60 ms
24,200 KB
testcase_03 AC 59 ms
22,160 KB
testcase_04 AC 59 ms
22,148 KB
testcase_05 AC 61 ms
20,048 KB
testcase_06 AC 59 ms
20,084 KB
testcase_07 AC 60 ms
20,084 KB
testcase_08 AC 60 ms
24,096 KB
testcase_09 AC 59 ms
22,192 KB
testcase_10 AC 58 ms
20,212 KB
testcase_11 AC 61 ms
21,992 KB
testcase_12 AC 60 ms
22,088 KB
testcase_13 AC 59 ms
20,084 KB
testcase_14 AC 60 ms
22,244 KB
testcase_15 AC 58 ms
21,992 KB
testcase_16 AC 58 ms
22,132 KB
testcase_17 AC 59 ms
22,176 KB
testcase_18 AC 58 ms
22,232 KB
testcase_19 AC 59 ms
22,060 KB
testcase_20 AC 59 ms
24,128 KB
testcase_21 AC 58 ms
22,152 KB
testcase_22 AC 59 ms
22,056 KB
testcase_23 AC 60 ms
22,180 KB
testcase_24 AC 59 ms
22,064 KB
testcase_25 AC 60 ms
22,140 KB
testcase_26 AC 58 ms
24,108 KB
testcase_27 AC 58 ms
22,144 KB
testcase_28 AC 58 ms
22,168 KB
testcase_29 AC 59 ms
24,112 KB
testcase_30 AC 58 ms
22,232 KB
testcase_31 AC 58 ms
20,080 KB
testcase_32 AC 60 ms
24,184 KB
testcase_33 AC 60 ms
22,008 KB
testcase_34 AC 60 ms
22,132 KB
testcase_35 AC 61 ms
24,136 KB
testcase_36 AC 59 ms
22,212 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

module Yuki

open System

let rec inline gcd a b = 
    let rec f a b =
        if a < b then f b a
        elif b = 0L then a
        else f b (a % b)
    f a b

let inline lcm a b = a * (b / (gcd a b))

let solve N a b c =
    let cA = N / a
    let cB = N / b
    let cC = N / c
    let cAB = N / (lcm a b)
    let cBC = N / (lcm b c)
    let cCA = N / (lcm c a)
    let cABC = N / (lcm a (lcm b c))
    cA + cB + cC - (cAB + cBC + cCA) + cABC

let N = Console.ReadLine() |> int64
let a, b, c =
    let t = 
        Console.ReadLine().Split()
        |> Array.map int64
    t.[0], t.[1], t.[2]

solve N a b c
|> Console.WriteLine
0