結果
問題 |
No.1917 LCMST
|
ユーザー |
![]() |
提出日時 | 2025-06-12 14:58:36 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 387 bytes |
コンパイル時間 | 418 ms |
コンパイル使用メモリ | 82,212 KB |
実行使用メモリ | 219,484 KB |
最終ジャッジ日時 | 2025-06-12 14:59:48 |
合計ジャッジ時間 | 15,286 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 1 WA * 41 |
ソースコード
import sys import math def main(): n = int(sys.stdin.readline()) A = list(map(int, sys.stdin.readline().split())) x = min(A) k = A.count(x) total = 0 for a in A: g = math.gcd(x, a) lcm = x * a // g total += lcm if k > 1: total -= x * (k - 1) else: total -= x print(total) if __name__ == "__main__": main()