結果

問題 No.1233 割り切れない気持ち
ユーザー mlihua09
提出日時 2020-09-18 22:03:13
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 379 bytes
コンパイル時間 351 ms
コンパイル使用メモリ 82,336 KB
実行使用メモリ 109,380 KB
最終ジャッジ日時 2024-06-22 16:53:36
合計ジャッジ時間 6,158 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 17 RE * 22
権限があれば一括ダウンロードができます

ソースコード

diff #


N = int(input())

A = list(map(int, input().split()))

A.sort()

ans = sum(A) * N

from bisect import bisect_left
X = A[-1]
note = [0] * (10 ** 5 + 1)

for a in A:
    note[a] += 1
    
S = note.copy()

for i in range(10 ** 5, 0, -1):
    S[i - 1] += S[i]

for i in range(1, 10 ** 5 + 1):
    for j in range(i, 10 ** 5 + 1, i):
        ans -= note[i] * i * S[j]
    
print(ans)
0