結果

問題 No.1233 割り切れない気持ち
ユーザー convexineqconvexineq
提出日時 2021-02-17 22:47:19
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 169 ms / 3,153 ms
コード長 327 bytes
コンパイル時間 259 ms
コンパイル使用メモリ 86,992 KB
実行使用メモリ 115,904 KB
最終ジャッジ日時 2023-10-12 08:38:53
合計ジャッジ時間 9,925 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 111 ms
82,808 KB
testcase_01 AC 108 ms
82,552 KB
testcase_02 AC 107 ms
82,748 KB
testcase_03 AC 108 ms
83,200 KB
testcase_04 AC 108 ms
83,140 KB
testcase_05 AC 107 ms
82,776 KB
testcase_06 AC 106 ms
83,012 KB
testcase_07 AC 121 ms
90,876 KB
testcase_08 AC 130 ms
97,452 KB
testcase_09 AC 148 ms
110,644 KB
testcase_10 AC 150 ms
108,824 KB
testcase_11 AC 119 ms
89,648 KB
testcase_12 AC 162 ms
108,172 KB
testcase_13 AC 164 ms
108,328 KB
testcase_14 AC 169 ms
108,276 KB
testcase_15 AC 162 ms
108,168 KB
testcase_16 AC 162 ms
108,084 KB
testcase_17 AC 148 ms
115,904 KB
testcase_18 AC 158 ms
108,272 KB
testcase_19 AC 160 ms
107,728 KB
testcase_20 AC 147 ms
115,656 KB
testcase_21 AC 151 ms
111,836 KB
testcase_22 AC 151 ms
111,576 KB
testcase_23 AC 152 ms
111,364 KB
testcase_24 AC 153 ms
111,552 KB
testcase_25 AC 153 ms
111,612 KB
testcase_26 AC 153 ms
111,608 KB
testcase_27 AC 162 ms
113,240 KB
testcase_28 AC 161 ms
113,136 KB
testcase_29 AC 166 ms
113,012 KB
testcase_30 AC 161 ms
113,184 KB
testcase_31 AC 163 ms
113,240 KB
testcase_32 AC 162 ms
113,196 KB
testcase_33 AC 161 ms
113,044 KB
testcase_34 AC 161 ms
113,320 KB
testcase_35 AC 162 ms
113,208 KB
testcase_36 AC 163 ms
113,184 KB
testcase_37 AC 107 ms
83,052 KB
testcase_38 AC 146 ms
115,628 KB
testcase_39 AC 160 ms
114,848 KB
testcase_40 AC 160 ms
114,764 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
*a, = map(int,input().split())
N = 2*10**5+3
r = [0]*N
for ai in a:
    r[ai] += 1
acc = r[:] + [0]
for i in range(N)[::-1]:
    acc[i] += acc[i+1]

ans = sum(a)*(n-r[1])
for i in range(2,N):
    v = 0
    for j in range(1,N//i+1):
        v += j*(acc[j*i] - acc[min(N,(j+1)*i)])
    ans -= r[i]*i*v
print(ans)
0