結果

問題 No.1233 割り切れない気持ち
ユーザー roarisroaris
提出日時 2020-12-03 09:02:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 179 ms / 3,153 ms
コード長 421 bytes
コンパイル時間 289 ms
コンパイル使用メモリ 87,324 KB
実行使用メモリ 120,852 KB
最終ジャッジ日時 2023-10-11 17:49:12
合計ジャッジ時間 11,193 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
91,280 KB
testcase_01 AC 117 ms
91,012 KB
testcase_02 AC 121 ms
91,356 KB
testcase_03 AC 122 ms
91,220 KB
testcase_04 AC 122 ms
91,484 KB
testcase_05 AC 121 ms
91,432 KB
testcase_06 AC 121 ms
91,400 KB
testcase_07 AC 179 ms
97,788 KB
testcase_08 AC 140 ms
103,204 KB
testcase_09 AC 157 ms
114,900 KB
testcase_10 AC 157 ms
117,772 KB
testcase_11 AC 131 ms
96,988 KB
testcase_12 AC 160 ms
107,296 KB
testcase_13 AC 161 ms
107,504 KB
testcase_14 AC 159 ms
107,640 KB
testcase_15 AC 166 ms
107,500 KB
testcase_16 AC 167 ms
107,432 KB
testcase_17 AC 149 ms
119,776 KB
testcase_18 AC 155 ms
107,592 KB
testcase_19 AC 157 ms
107,488 KB
testcase_20 AC 150 ms
119,948 KB
testcase_21 AC 160 ms
120,744 KB
testcase_22 AC 160 ms
120,580 KB
testcase_23 AC 159 ms
120,576 KB
testcase_24 AC 158 ms
120,568 KB
testcase_25 AC 161 ms
120,420 KB
testcase_26 AC 158 ms
120,568 KB
testcase_27 AC 158 ms
120,800 KB
testcase_28 AC 161 ms
120,852 KB
testcase_29 AC 164 ms
120,668 KB
testcase_30 AC 161 ms
120,844 KB
testcase_31 AC 162 ms
120,488 KB
testcase_32 AC 161 ms
120,592 KB
testcase_33 AC 161 ms
120,560 KB
testcase_34 AC 160 ms
120,648 KB
testcase_35 AC 160 ms
120,540 KB
testcase_36 AC 162 ms
120,732 KB
testcase_37 AC 116 ms
91,132 KB
testcase_38 AC 151 ms
119,664 KB
testcase_39 AC 155 ms
120,244 KB
testcase_40 AC 160 ms
120,280 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N = int(input())
A = list(map(int, input().split()))
s = sum(A)
c = [0]*(2*10**5+1)

for Ai in A:
    c[Ai] += 1

acc = [0]

for i in range(2*10**5+1):
    acc.append(acc[-1]+c[i])

ans = 0

for i in range(1, 2*10**5+1):
    add = s
    j = 0
    
    while i*j<=2*10**5:
        add -= (acc[min(2*10**5+1, i*(j+1))]-acc[i*j])*i*j
        j += 1
    
    ans += add*c[i]

print(ans)
0