結果

問題 No.316 もっと刺激的なFizzBuzzをください
ユーザー taktak
提出日時 2019-06-22 14:06:08
言語 F#
(F# 4.0)
結果
WA  
実行時間 -
コード長 576 bytes
コンパイル時間 5,835 ms
コンパイル使用メモリ 161,316 KB
実行使用メモリ 26,216 KB
最終ジャッジ日時 2023-08-27 02:46:22
合計ジャッジ時間 10,465 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
22,088 KB
testcase_01 AC 62 ms
22,108 KB
testcase_02 AC 60 ms
20,132 KB
testcase_03 AC 61 ms
22,164 KB
testcase_04 AC 61 ms
22,232 KB
testcase_05 AC 61 ms
24,060 KB
testcase_06 AC 62 ms
22,160 KB
testcase_07 AC 62 ms
26,216 KB
testcase_08 AC 62 ms
22,036 KB
testcase_09 AC 61 ms
24,140 KB
testcase_10 AC 61 ms
22,156 KB
testcase_11 AC 60 ms
20,112 KB
testcase_12 AC 61 ms
22,056 KB
testcase_13 AC 60 ms
22,200 KB
testcase_14 AC 60 ms
20,060 KB
testcase_15 AC 61 ms
20,064 KB
testcase_16 AC 61 ms
22,156 KB
testcase_17 AC 61 ms
24,180 KB
testcase_18 AC 58 ms
22,224 KB
testcase_19 AC 58 ms
22,156 KB
testcase_20 AC 60 ms
22,164 KB
testcase_21 AC 62 ms
24,220 KB
testcase_22 AC 59 ms
22,196 KB
testcase_23 AC 59 ms
22,024 KB
testcase_24 AC 60 ms
24,164 KB
testcase_25 AC 59 ms
26,188 KB
testcase_26 AC 60 ms
24,172 KB
testcase_27 AC 60 ms
22,192 KB
testcase_28 AC 60 ms
20,056 KB
testcase_29 WA -
testcase_30 AC 61 ms
24,128 KB
testcase_31 AC 61 ms
22,100 KB
testcase_32 AC 60 ms
22,232 KB
testcase_33 AC 61 ms
22,220 KB
testcase_34 AC 61 ms
22,096 KB
testcase_35 AC 62 ms
24,140 KB
testcase_36 AC 61 ms
22,116 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 = 0 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() |> int
let a, b, c =
    let t = 
        Console.ReadLine().Split()
        |> Array.map int
    t.[0], t.[1], t.[2]

solve N a b c
|> Console.WriteLine
0