結果

問題 No.736 約比
ユーザー taktak
提出日時 2019-02-03 18:29:05
言語 F#
(F# 4.0)
結果
AC  
実行時間 65 ms / 2,000 ms
コード長 365 bytes
コンパイル時間 4,648 ms
コンパイル使用メモリ 162,220 KB
実行使用メモリ 24,572 KB
最終ジャッジ日時 2023-08-22 21:01:13
合計ジャッジ時間 10,520 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
22,296 KB
testcase_01 AC 61 ms
22,240 KB
testcase_02 AC 62 ms
24,404 KB
testcase_03 AC 61 ms
24,340 KB
testcase_04 AC 63 ms
24,396 KB
testcase_05 AC 63 ms
22,300 KB
testcase_06 AC 62 ms
24,252 KB
testcase_07 AC 62 ms
24,304 KB
testcase_08 AC 61 ms
20,420 KB
testcase_09 AC 62 ms
22,168 KB
testcase_10 AC 61 ms
20,320 KB
testcase_11 AC 61 ms
22,436 KB
testcase_12 AC 62 ms
22,500 KB
testcase_13 AC 61 ms
24,420 KB
testcase_14 AC 61 ms
24,336 KB
testcase_15 AC 61 ms
22,476 KB
testcase_16 AC 61 ms
22,296 KB
testcase_17 AC 61 ms
22,268 KB
testcase_18 AC 61 ms
22,500 KB
testcase_19 AC 62 ms
24,344 KB
testcase_20 AC 62 ms
22,460 KB
testcase_21 AC 61 ms
24,328 KB
testcase_22 AC 62 ms
22,176 KB
testcase_23 AC 62 ms
22,348 KB
testcase_24 AC 61 ms
22,336 KB
testcase_25 AC 61 ms
24,268 KB
testcase_26 AC 61 ms
24,336 KB
testcase_27 AC 61 ms
22,356 KB
testcase_28 AC 65 ms
22,264 KB
testcase_29 AC 61 ms
22,332 KB
testcase_30 AC 61 ms
22,440 KB
testcase_31 AC 61 ms
22,428 KB
testcase_32 AC 62 ms
24,356 KB
testcase_33 AC 62 ms
24,572 KB
testcase_34 AC 60 ms
22,240 KB
testcase_35 AC 61 ms
22,232 KB
testcase_36 AC 63 ms
24,232 KB
testcase_37 AC 61 ms
24,424 KB
testcase_38 AC 60 ms
22,440 KB
testcase_39 AC 58 ms
22,404 KB
testcase_40 AC 61 ms
24,260 KB
testcase_41 AC 60 ms
20,444 KB
testcase_42 AC 61 ms
22,352 KB
testcase_43 AC 60 ms
20,312 KB
testcase_44 AC 64 ms
22,428 KB
testcase_45 AC 61 ms
22,348 KB
testcase_46 AC 62 ms
22,244 KB
testcase_47 AC 61 ms
22,324 KB
testcase_48 AC 60 ms
20,256 KB
testcase_49 AC 61 ms
24,256 KB
testcase_50 AC 60 ms
22,356 KB
testcase_51 AC 61 ms
24,224 KB
testcase_52 AC 61 ms
22,492 KB
testcase_53 AC 61 ms
22,348 KB
testcase_54 AC 61 ms
24,444 KB
testcase_55 AC 63 ms
22,292 KB
testcase_56 AC 61 ms
22,444 KB
testcase_57 AC 62 ms
24,376 KB
testcase_58 AC 62 ms
24,324 KB
testcase_59 AC 61 ms
22,380 KB
testcase_60 AC 61 ms
22,324 KB
testcase_61 AC 61 ms
24,292 KB
testcase_62 AC 61 ms
20,384 KB
testcase_63 AC 60 ms
22,324 KB
testcase_64 AC 60 ms
24,332 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

open System

let rec gcd a b =
    if a < b then 
        gcd b a
    else
        match b with
        | 0L -> a
        | b -> gcd b (a%b)

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

let ans = 
    let gcd' = a |> Array.reduce gcd
    let a' = a |> Array.map (fun x -> x / gcd')
    String.Join(":", a')

ans |> stdout.WriteLine
0