結果
問題 |
No.1917 LCMST
|
ユーザー |
![]() |
提出日時 | 2025-04-16 01:02:03 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 240 bytes |
コンパイル時間 | 357 ms |
コンパイル使用メモリ | 81,288 KB |
実行使用メモリ | 224,460 KB |
最終ジャッジ日時 | 2025-04-16 01:03:55 |
合計ジャッジ時間 | 14,568 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 9 WA * 33 |
ソースコード
import math n = int(input()) a = list(map(int, input().split())) x = min(a) k = a.count(x) sum_lcm = 0 for num in a: if num != x: g = math.gcd(x, num) sum_lcm += x * num // g total = sum_lcm + x * (k - 1) print(total)