結果

問題 No.1233 割り切れない気持ち
ユーザー NatsubiSoganNatsubiSogan
提出日時 2020-09-26 18:42:01
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,161 ms / 3,153 ms
コード長 345 bytes
コンパイル時間 477 ms
コンパイル使用メモリ 10,644 KB
実行使用メモリ 32,472 KB
最終ジャッジ日時 2023-09-12 00:01:17
合計ジャッジ時間 15,722 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,196 KB
testcase_01 AC 16 ms
8,188 KB
testcase_02 AC 16 ms
8,096 KB
testcase_03 AC 18 ms
8,212 KB
testcase_04 AC 18 ms
8,276 KB
testcase_05 AC 17 ms
8,200 KB
testcase_06 AC 16 ms
8,196 KB
testcase_07 AC 188 ms
14,000 KB
testcase_08 AC 302 ms
18,244 KB
testcase_09 AC 595 ms
27,028 KB
testcase_10 AC 642 ms
28,364 KB
testcase_11 AC 152 ms
13,828 KB
testcase_12 AC 781 ms
29,944 KB
testcase_13 AC 806 ms
30,044 KB
testcase_14 AC 786 ms
29,876 KB
testcase_15 AC 789 ms
29,944 KB
testcase_16 AC 822 ms
29,868 KB
testcase_17 AC 74 ms
12,068 KB
testcase_18 AC 1,161 ms
30,028 KB
testcase_19 AC 128 ms
32,472 KB
testcase_20 AC 75 ms
12,092 KB
testcase_21 AC 95 ms
30,764 KB
testcase_22 AC 94 ms
30,656 KB
testcase_23 AC 95 ms
30,616 KB
testcase_24 AC 94 ms
30,644 KB
testcase_25 AC 94 ms
30,680 KB
testcase_26 AC 96 ms
31,644 KB
testcase_27 AC 141 ms
30,992 KB
testcase_28 AC 141 ms
31,036 KB
testcase_29 AC 142 ms
30,880 KB
testcase_30 AC 138 ms
30,928 KB
testcase_31 AC 138 ms
30,992 KB
testcase_32 AC 140 ms
30,876 KB
testcase_33 AC 138 ms
30,924 KB
testcase_34 AC 137 ms
31,092 KB
testcase_35 AC 140 ms
30,992 KB
testcase_36 AC 135 ms
30,940 KB
testcase_37 AC 15 ms
8,096 KB
testcase_38 AC 172 ms
19,536 KB
testcase_39 AC 642 ms
22,076 KB
testcase_40 AC 657 ms
22,216 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import accumulate
n = int(input())
a = list(map(int, input().split()))
ans = 0
m = max(a)
lis = [0] * (m + 1)
for i in a:
    lis[i] += 1
cum = list(accumulate(lis))
for i in range(1, m + 1):
    if lis[i] == 0:
        continue
    for j in range(i, m + 1, i):
        ans += lis[i] * i * (n - cum[j - 1])
print(sum(a) * n - ans)
0