結果
問題 |
No.736 約比
|
ユーザー |
|
提出日時 | 2021-06-22 11:55:06 |
言語 | Swift (6.0.3) |
結果 |
WA
|
実行時間 | - |
コード長 | 423 bytes |
コンパイル時間 | 6,163 ms |
コンパイル使用メモリ | 193,636 KB |
実行使用メモリ | 21,248 KB |
最終ジャッジ日時 | 2024-06-23 07:59:04 |
合計ジャッジ時間 | 13,772 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 63 TLE * 2 |
ソースコード
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)!) } } } print(x) a = a.map{$0 / x.max()!} print(a.map{String($0)}.joined(separator: ":"))