結果

問題 No.1233 割り切れない気持ち
ユーザー ayaoniayaoni
提出日時 2020-11-22 09:24:38
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 555 bytes
コンパイル時間 485 ms
コンパイル使用メモリ 87,140 KB
実行使用メモリ 116,556 KB
最終ジャッジ日時 2023-09-30 22:32:58
合計ジャッジ時間 9,092 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 96 ms
91,220 KB
testcase_01 AC 98 ms
91,276 KB
testcase_02 AC 107 ms
91,380 KB
testcase_03 AC 117 ms
91,616 KB
testcase_04 AC 114 ms
91,680 KB
testcase_05 AC 108 ms
91,472 KB
testcase_06 AC 107 ms
91,136 KB
testcase_07 AC 154 ms
98,624 KB
testcase_08 AC 153 ms
103,924 KB
testcase_09 WA -
testcase_10 AC 180 ms
108,780 KB
testcase_11 AC 140 ms
97,336 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 124 ms
116,556 KB
testcase_18 WA -
testcase_19 AC 134 ms
109,272 KB
testcase_20 AC 126 ms
116,548 KB
testcase_21 AC 127 ms
111,976 KB
testcase_22 AC 137 ms
111,840 KB
testcase_23 AC 135 ms
111,924 KB
testcase_24 AC 135 ms
112,040 KB
testcase_25 AC 135 ms
111,896 KB
testcase_26 AC 135 ms
111,892 KB
testcase_27 AC 141 ms
109,580 KB
testcase_28 AC 138 ms
109,752 KB
testcase_29 WA -
testcase_30 AC 136 ms
109,568 KB
testcase_31 AC 137 ms
109,616 KB
testcase_32 AC 136 ms
109,672 KB
testcase_33 AC 137 ms
109,668 KB
testcase_34 AC 138 ms
109,600 KB
testcase_35 AC 135 ms
109,668 KB
testcase_36 AC 136 ms
109,524 KB
testcase_37 AC 95 ms
91,128 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from itertools import accumulate
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))


N = I()
A = LI()
count = [0]*(2*10**5+1)
for a in A:
    count[a] += 1
s_count = list(accumulate(count))

ans = N*sum(A)
for i in range(1,2*10**5+1):
    if count[i] == 0:
        continue
    a = 0
    j = 1
    for j in range(2*i-1,2*10**5+1,i):
        a += j//i*(s_count[j]-s_count[j-i])
    a += 2*10**5//i*(s_count[-1]-s_count[i*(2*10**5//i)-1])
    ans -= a*count[i]*i

print(ans)
0