結果

問題 No.1233 割り切れない気持ち
ユーザー mlihua09mlihua09
提出日時 2020-09-18 22:04:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 175 ms / 3,153 ms
コード長 395 bytes
コンパイル時間 286 ms
コンパイル使用メモリ 87,080 KB
実行使用メモリ 111,664 KB
最終ジャッジ日時 2023-09-04 21:48:08
合計ジャッジ時間 8,087 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 95 ms
79,692 KB
testcase_01 AC 97 ms
79,860 KB
testcase_02 AC 98 ms
79,800 KB
testcase_03 AC 100 ms
79,760 KB
testcase_04 AC 99 ms
79,752 KB
testcase_05 AC 99 ms
79,796 KB
testcase_06 AC 96 ms
79,824 KB
testcase_07 AC 118 ms
86,732 KB
testcase_08 AC 131 ms
92,500 KB
testcase_09 AC 159 ms
104,792 KB
testcase_10 AC 166 ms
108,096 KB
testcase_11 AC 117 ms
86,072 KB
testcase_12 AC 172 ms
110,496 KB
testcase_13 AC 175 ms
110,940 KB
testcase_14 AC 173 ms
110,240 KB
testcase_15 AC 172 ms
110,208 KB
testcase_16 AC 172 ms
110,584 KB
testcase_17 AC 134 ms
108,116 KB
testcase_18 AC 143 ms
110,548 KB
testcase_19 AC 143 ms
109,196 KB
testcase_20 AC 134 ms
108,208 KB
testcase_21 AC 165 ms
110,900 KB
testcase_22 AC 164 ms
110,764 KB
testcase_23 AC 166 ms
110,864 KB
testcase_24 AC 164 ms
110,824 KB
testcase_25 AC 161 ms
111,140 KB
testcase_26 AC 162 ms
111,212 KB
testcase_27 AC 165 ms
111,432 KB
testcase_28 AC 163 ms
110,900 KB
testcase_29 AC 164 ms
110,904 KB
testcase_30 AC 166 ms
111,088 KB
testcase_31 AC 164 ms
111,612 KB
testcase_32 AC 166 ms
110,948 KB
testcase_33 AC 166 ms
111,088 KB
testcase_34 AC 164 ms
111,028 KB
testcase_35 AC 165 ms
111,176 KB
testcase_36 AC 163 ms
111,664 KB
testcase_37 AC 99 ms
79,616 KB
testcase_38 AC 135 ms
107,896 KB
testcase_39 AC 139 ms
109,256 KB
testcase_40 AC 138 ms
109,192 KB
権限があれば一括ダウンロードができます

ソースコード

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] * (2 * 10 ** 5 + 1)

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

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

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