結果

問題 No.1233 割り切れない気持ち
ユーザー mlihua09mlihua09
提出日時 2020-09-18 22:03:13
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 379 bytes
コンパイル時間 984 ms
コンパイル使用メモリ 87,144 KB
実行使用メモリ 109,876 KB
最終ジャッジ日時 2023-09-04 19:09:00
合計ジャッジ時間 10,125 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 87 ms
77,588 KB
testcase_01 AC 92 ms
77,848 KB
testcase_02 AC 90 ms
77,852 KB
testcase_03 AC 88 ms
77,588 KB
testcase_04 AC 90 ms
77,472 KB
testcase_05 AC 88 ms
77,800 KB
testcase_06 AC 88 ms
77,584 KB
testcase_07 AC 108 ms
84,464 KB
testcase_08 AC 120 ms
90,332 KB
testcase_09 RE -
testcase_10 RE -
testcase_11 AC 106 ms
83,776 KB
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 AC 130 ms
106,268 KB
testcase_18 RE -
testcase_19 RE -
testcase_20 AC 128 ms
106,232 KB
testcase_21 AC 159 ms
109,332 KB
testcase_22 AC 161 ms
108,596 KB
testcase_23 AC 161 ms
108,776 KB
testcase_24 AC 160 ms
109,192 KB
testcase_25 AC 160 ms
109,456 KB
testcase_26 AC 158 ms
109,568 KB
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
testcase_33 RE -
testcase_34 RE -
testcase_35 RE -
testcase_36 RE -
testcase_37 AC 89 ms
77,720 KB
testcase_38 RE -
testcase_39 RE -
testcase_40 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #


N = int(input())

A = list(map(int, input().split()))

A.sort()

ans = sum(A) * N

from bisect import bisect_left
X = A[-1]
note = [0] * (10 ** 5 + 1)

for a in A:
    note[a] += 1
    
S = note.copy()

for i in range(10 ** 5, 0, -1):
    S[i - 1] += S[i]

for i in range(1, 10 ** 5 + 1):
    for j in range(i, 10 ** 5 + 1, i):
        ans -= note[i] * i * S[j]
    
print(ans)
0