結果
問題 |
No.736 約比
|
ユーザー |
|
提出日時 | 2021-06-22 11:59:32 |
言語 | Swift (6.0.3) |
結果 |
WA
|
実行時間 | - |
コード長 | 414 bytes |
コンパイル時間 | 3,703 ms |
コンパイル使用メモリ | 194,160 KB |
実行使用メモリ | 21,536 KB |
最終ジャッジ日時 | 2024-06-23 08:02:04 |
合計ジャッジ時間 | 11,084 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 44 WA * 2 TLE * 1 -- * 18 |
ソースコード
import Foundation let n = Int(readLine()!) var a = readLine()!.split(separator: " ").map{Int($0)!} var x = [1] let m = a.min()! for i in 2...Int(sqrt(Double(m))) + 1{ if m % i == 0{ x += [i,m / i] } } x.sort() for i in a{ for j in x{ if i % j != 0{ x.remove(at: x.firstIndex(of: j)!) } } } a = a.map{$0 / x.max()!} print(a.map{String($0)}.joined(separator: ":"))