結果
問題 |
No.1917 LCMST
|
ユーザー |
![]() |
提出日時 | 2025-06-12 21:31:27 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 327 bytes |
コンパイル時間 | 343 ms |
コンパイル使用メモリ | 81,708 KB |
実行使用メモリ | 224,232 KB |
最終ジャッジ日時 | 2025-06-12 21:32:50 |
合計ジャッジ時間 | 16,309 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 9 WA * 33 |
ソースコード
import sys import math def main(): input = sys.stdin.read().split() n = int(input[0]) A = list(map(int, input[1:n+1])) m = min(A) total = 0 for a in A: g = math.gcd(a, m) lcm = (a * m) // g total += lcm total -= m print(total) if __name__ == "__main__": main()