結果

問題 No.1233 割り切れない気持ち
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2022-10-08 15:31:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 198 ms / 3,153 ms
コード長 535 bytes
コンパイル時間 504 ms
コンパイル使用メモリ 87,328 KB
実行使用メモリ 123,452 KB
最終ジャッジ日時 2023-09-04 21:08:58
合計ジャッジ時間 9,549 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 110 ms
73,208 KB
testcase_01 AC 109 ms
73,296 KB
testcase_02 AC 108 ms
72,904 KB
testcase_03 AC 119 ms
77,724 KB
testcase_04 AC 120 ms
77,772 KB
testcase_05 AC 108 ms
72,800 KB
testcase_06 AC 108 ms
72,972 KB
testcase_07 AC 167 ms
89,284 KB
testcase_08 AC 160 ms
100,088 KB
testcase_09 AC 184 ms
112,580 KB
testcase_10 AC 187 ms
113,652 KB
testcase_11 AC 136 ms
87,892 KB
testcase_12 AC 197 ms
112,184 KB
testcase_13 AC 196 ms
111,956 KB
testcase_14 AC 192 ms
112,236 KB
testcase_15 AC 190 ms
112,088 KB
testcase_16 AC 198 ms
112,192 KB
testcase_17 AC 141 ms
105,664 KB
testcase_18 AC 190 ms
111,992 KB
testcase_19 AC 193 ms
112,080 KB
testcase_20 AC 144 ms
105,896 KB
testcase_21 AC 154 ms
107,896 KB
testcase_22 AC 154 ms
108,152 KB
testcase_23 AC 157 ms
107,952 KB
testcase_24 AC 161 ms
108,196 KB
testcase_25 AC 161 ms
107,924 KB
testcase_26 AC 156 ms
108,132 KB
testcase_27 AC 191 ms
114,532 KB
testcase_28 AC 192 ms
114,768 KB
testcase_29 AC 192 ms
114,724 KB
testcase_30 AC 188 ms
114,760 KB
testcase_31 AC 189 ms
114,768 KB
testcase_32 AC 195 ms
114,604 KB
testcase_33 AC 191 ms
114,668 KB
testcase_34 AC 192 ms
114,560 KB
testcase_35 AC 195 ms
114,716 KB
testcase_36 AC 195 ms
114,624 KB
testcase_37 AC 109 ms
73,088 KB
testcase_38 AC 193 ms
123,452 KB
testcase_39 AC 197 ms
111,120 KB
testcase_40 AC 195 ms
111,116 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# 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)
0