結果
| 問題 |
No.736 約比
|
| コンテスト | |
| ユーザー |
tak
|
| 提出日時 | 2019-02-03 18:28:10 |
| 言語 | F# (F# 4.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 362 bytes |
| コンパイル時間 | 12,488 ms |
| コンパイル使用メモリ | 186,140 KB |
| 実行使用メモリ | 39,312 KB |
| 最終ジャッジ日時 | 2024-12-17 22:48:22 |
| 合計ジャッジ時間 | 33,876 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 RE * 58 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (293 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/
ソースコード
open System
let rec gcd a b =
if a < b then
gcd b a
else
match b with
| 0 -> a
| b -> gcd b (a%b)
let N = stdin.ReadLine()
let a = stdin.ReadLine().Split() |> Array.map int
let ans =
let gcd' = a |> Array.reduce gcd
let a' = a |> Array.map (fun x -> x / gcd')
String.Join(":", a')
ans |> stdout.WriteLine
tak