結果

問題 No.316 もっと刺激的なFizzBuzzをください
ユーザー 826814741_6826814741_6
提出日時 2019-01-10 18:54:03
言語 F#
(F# 4.0)
結果
AC  
実行時間 321 ms / 1,000 ms
コード長 349 bytes
コンパイル時間 9,263 ms
コンパイル使用メモリ 187,824 KB
実行使用メモリ 34,760 KB
最終ジャッジ日時 2024-05-03 08:23:37
合計ジャッジ時間 21,869 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 303 ms
34,628 KB
testcase_01 AC 300 ms
34,760 KB
testcase_02 AC 295 ms
34,500 KB
testcase_03 AC 300 ms
33,728 KB
testcase_04 AC 298 ms
34,508 KB
testcase_05 AC 297 ms
34,352 KB
testcase_06 AC 304 ms
34,372 KB
testcase_07 AC 303 ms
34,496 KB
testcase_08 AC 314 ms
34,376 KB
testcase_09 AC 305 ms
34,500 KB
testcase_10 AC 306 ms
34,604 KB
testcase_11 AC 304 ms
34,500 KB
testcase_12 AC 301 ms
34,496 KB
testcase_13 AC 299 ms
34,500 KB
testcase_14 AC 299 ms
34,508 KB
testcase_15 AC 300 ms
33,944 KB
testcase_16 AC 305 ms
34,500 KB
testcase_17 AC 307 ms
34,508 KB
testcase_18 AC 320 ms
34,368 KB
testcase_19 AC 313 ms
34,356 KB
testcase_20 AC 300 ms
34,624 KB
testcase_21 AC 300 ms
34,500 KB
testcase_22 AC 306 ms
33,684 KB
testcase_23 AC 307 ms
33,688 KB
testcase_24 AC 297 ms
34,500 KB
testcase_25 AC 301 ms
34,352 KB
testcase_26 AC 310 ms
34,504 KB
testcase_27 AC 302 ms
34,500 KB
testcase_28 AC 302 ms
34,628 KB
testcase_29 AC 301 ms
34,464 KB
testcase_30 AC 319 ms
33,864 KB
testcase_31 AC 321 ms
33,812 KB
testcase_32 AC 317 ms
34,368 KB
testcase_33 AC 303 ms
34,632 KB
testcase_34 AC 305 ms
34,596 KB
testcase_35 AC 304 ms
34,368 KB
testcase_36 AC 305 ms
34,608 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (280 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

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