結果
| 問題 | No.1233 割り切れない気持ち |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-10-08 15:31:09 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 151 ms / 3,153 ms |
| + 546µs | |
| コード長 | 535 bytes |
| 記録 | |
| コンパイル時間 | 255 ms |
| コンパイル使用メモリ | 95,724 KB |
| 実行使用メモリ | 133,120 KB |
| 最終ジャッジ日時 | 2026-07-27 08:07:39 |
| 合計ジャッジ時間 | 8,212 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 39 |
ソースコード
# import pypyjit
# pypyjit.set_param('max_unroll_recursion=-1')
from collections import *
from itertools import *
from functools import *
from heapq import *
import sys,math
input = sys.stdin.readline
N = int(input())
A = list(map(int,input().split()))
S = sum(A)
M = max(A)
Y = [0]*(M+1)
for a in A:
Y[a] += 1
B = list(accumulate([0]+Y))
T = [0]*(M+1)
for i in range(1,M+1):
n = 1
while n*i<=M:
T[i] += n*(B[min((n+1)*i,M+1)] - B[n*i])
n += 1
ans = 0
for a in A:
ans += a*T[a]
print(N*S - ans)