結果
問題 | No.736 約比 |
ユーザー |
|
提出日時 | 2021-06-22 11:48:41 |
言語 | Swift (6.0.3) |
結果 |
WA
|
実行時間 | - |
コード長 | 424 bytes |
コンパイル時間 | 11,645 ms |
コンパイル使用メモリ | 194,444 KB |
実行使用メモリ | 21,120 KB |
最終ジャッジ日時 | 2024-06-23 07:52:19 |
合計ジャッジ時間 | 12,140 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 46 TLE * 1 -- * 18 |
ソースコード
import Foundation let n = Int(readLine()!) var a = readLine()!.split(separator: " ").map{Int($0)!}.sorted() var x = [1] for i in 2...Int(sqrt(Double(a[0])) + 1){ if a[0] % i == 0{ x += [i,a[0] / 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: ":"))