結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 96 ms
91,356 KB
testcase_01 AC 92 ms
91,236 KB
testcase_02 AC 105 ms
91,476 KB
testcase_03 AC 117 ms
91,708 KB
testcase_04 AC 114 ms
91,764 KB
testcase_05 AC 107 ms
91,240 KB
testcase_06 AC 106 ms
91,152 KB
testcase_07 AC 141 ms
98,772 KB
testcase_08 AC 146 ms
104,028 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 134 ms
97,420 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 124 ms
116,876 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 126 ms
116,684 KB
testcase_21 AC 129 ms
111,996 KB
testcase_22 AC 128 ms
111,932 KB
testcase_23 AC 128 ms
112,008 KB
testcase_24 AC 127 ms
112,000 KB
testcase_25 AC 127 ms
112,040 KB
testcase_26 AC 127 ms
112,000 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 92 ms
91,160 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
    for j in range(2*i-1,2*10**5+1,i):
        a += j//i*(s_count[j]-s_count[j-i])
    ans -= a*count[i]*i

print(ans)
0