結果

問題 No.316 もっと刺激的なFizzBuzzをください
ユーザー 826814741_6826814741_6
提出日時 2019-01-10 18:54:03
言語 F#
(F# 4.0)
結果
AC  
実行時間 83 ms / 1,000 ms
コード長 349 bytes
コンパイル時間 5,188 ms
コンパイル使用メモリ 157,916 KB
実行使用メモリ 24,948 KB
最終ジャッジ日時 2023-08-15 21:54:06
合計ジャッジ時間 7,772 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
24,820 KB
testcase_01 AC 69 ms
22,852 KB
testcase_02 AC 70 ms
22,820 KB
testcase_03 AC 72 ms
22,776 KB
testcase_04 AC 70 ms
22,744 KB
testcase_05 AC 72 ms
22,844 KB
testcase_06 AC 71 ms
22,876 KB
testcase_07 AC 74 ms
20,652 KB
testcase_08 AC 72 ms
22,844 KB
testcase_09 AC 71 ms
22,808 KB
testcase_10 AC 72 ms
24,852 KB
testcase_11 AC 73 ms
22,808 KB
testcase_12 AC 72 ms
22,820 KB
testcase_13 AC 72 ms
22,756 KB
testcase_14 AC 72 ms
22,932 KB
testcase_15 AC 69 ms
22,900 KB
testcase_16 AC 71 ms
24,948 KB
testcase_17 AC 83 ms
22,920 KB
testcase_18 AC 82 ms
24,920 KB
testcase_19 AC 70 ms
22,904 KB
testcase_20 AC 70 ms
22,812 KB
testcase_21 AC 69 ms
20,712 KB
testcase_22 AC 70 ms
22,848 KB
testcase_23 AC 71 ms
22,908 KB
testcase_24 AC 70 ms
24,788 KB
testcase_25 AC 72 ms
22,800 KB
testcase_26 AC 70 ms
22,696 KB
testcase_27 AC 70 ms
22,804 KB
testcase_28 AC 71 ms
20,856 KB
testcase_29 AC 73 ms
22,840 KB
testcase_30 AC 76 ms
20,776 KB
testcase_31 AC 71 ms
22,668 KB
testcase_32 AC 70 ms
20,816 KB
testcase_33 AC 71 ms
22,940 KB
testcase_34 AC 72 ms
24,892 KB
testcase_35 AC 71 ms
22,752 KB
testcase_36 AC 71 ms
24,804 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

let inline isZero n = n=LanguagePrimitives.GenericZero
let rec gcd a b = if isZero b then a else gcd b (a%b)
let lcm a b = a/(gcd a b)*b
let f n a b c = n/a+n/b+n/c-n/(lcm a b)-n/(lcm b c)-n/(lcm c a)+n/(lcm (lcm a b) c)

let n = stdin.ReadLine() |> int64
let a = stdin.ReadLine().Split(' ') |> Array.map int64

f n a.[0] a.[1] a.[2] |> printfn "%d"
0