結果

問題 No.316 もっと刺激的なFizzBuzzをください
ユーザー taktak
提出日時 2019-06-22 14:08:31
言語 F#
(.NET 7)
結果
AC  
実行時間 58 ms / 1,000 ms
コード長 581 bytes
コンパイル時間 3,477 ms
コンパイル使用メモリ 161,988 KB
実行使用メモリ 24,200 KB
最終ジャッジ日時 2023-08-27 02:46:43
合計ジャッジ時間 6,591 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
22,148 KB
testcase_01 AC 55 ms
22,240 KB
testcase_02 AC 52 ms
22,084 KB
testcase_03 AC 53 ms
22,156 KB
testcase_04 AC 53 ms
22,148 KB
testcase_05 AC 52 ms
22,128 KB
testcase_06 AC 52 ms
24,148 KB
testcase_07 AC 53 ms
22,152 KB
testcase_08 AC 54 ms
22,100 KB
testcase_09 AC 54 ms
22,072 KB
testcase_10 AC 55 ms
24,188 KB
testcase_11 AC 53 ms
22,128 KB
testcase_12 AC 56 ms
22,056 KB
testcase_13 AC 54 ms
22,060 KB
testcase_14 AC 55 ms
22,172 KB
testcase_15 AC 55 ms
22,236 KB
testcase_16 AC 54 ms
24,068 KB
testcase_17 AC 52 ms
22,108 KB
testcase_18 AC 52 ms
22,104 KB
testcase_19 AC 53 ms
22,148 KB
testcase_20 AC 53 ms
20,224 KB
testcase_21 AC 51 ms
24,156 KB
testcase_22 AC 52 ms
22,164 KB
testcase_23 AC 54 ms
22,124 KB
testcase_24 AC 52 ms
22,168 KB
testcase_25 AC 54 ms
24,200 KB
testcase_26 AC 54 ms
24,124 KB
testcase_27 AC 54 ms
22,132 KB
testcase_28 AC 55 ms
20,020 KB
testcase_29 AC 53 ms
22,060 KB
testcase_30 AC 54 ms
22,216 KB
testcase_31 AC 53 ms
22,160 KB
testcase_32 AC 56 ms
22,164 KB
testcase_33 AC 58 ms
22,100 KB
testcase_34 AC 53 ms
22,160 KB
testcase_35 AC 55 ms
22,128 KB
testcase_36 AC 57 ms
24,200 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 gcd a b = 
    if a < b then gcd b a
    elif b = 0L then a
    else gcd b (a % b)

let 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