結果

問題 No.1233 割り切れない気持ち
ユーザー rlangevinrlangevin
提出日時 2023-10-30 12:12:06
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 338 bytes
コンパイル時間 191 ms
コンパイル使用メモリ 81,836 KB
実行使用メモリ 109,704 KB
最終ジャッジ日時 2023-10-30 12:12:26
合計ジャッジ時間 18,641 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
53,584 KB
testcase_01 AC 35 ms
53,584 KB
testcase_02 AC 35 ms
53,584 KB
testcase_03 AC 44 ms
62,172 KB
testcase_04 AC 43 ms
62,172 KB
testcase_05 AC 35 ms
53,584 KB
testcase_06 AC 35 ms
53,584 KB
testcase_07 AC 75 ms
78,824 KB
testcase_08 AC 91 ms
88,372 KB
testcase_09 AC 136 ms
101,916 KB
testcase_10 AC 139 ms
105,172 KB
testcase_11 AC 69 ms
77,684 KB
testcase_12 AC 165 ms
109,440 KB
testcase_13 AC 151 ms
109,116 KB
testcase_14 AC 152 ms
109,440 KB
testcase_15 AC 155 ms
109,440 KB
testcase_16 AC 157 ms
109,440 KB
testcase_17 AC 72 ms
100,824 KB
testcase_18 AC 148 ms
109,380 KB
testcase_19 AC 97 ms
109,704 KB
testcase_20 AC 73 ms
98,776 KB
testcase_21 AC 91 ms
102,020 KB
testcase_22 AC 81 ms
102,020 KB
testcase_23 AC 83 ms
102,020 KB
testcase_24 AC 82 ms
102,020 KB
testcase_25 AC 86 ms
102,020 KB
testcase_26 AC 85 ms
102,020 KB
testcase_27 AC 1,148 ms
108,592 KB
testcase_28 AC 1,089 ms
108,592 KB
testcase_29 AC 711 ms
108,592 KB
testcase_30 AC 689 ms
108,592 KB
testcase_31 AC 619 ms
108,592 KB
testcase_32 AC 618 ms
108,592 KB
testcase_33 AC 559 ms
108,592 KB
testcase_34 AC 552 ms
108,592 KB
testcase_35 AC 507 ms
108,592 KB
testcase_36 AC 512 ms
108,592 KB
testcase_37 AC 34 ms
53,584 KB
testcase_38 TLE -
testcase_39 -- -
testcase_40 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))
M = max(A)
D = [0] * (M + 1)
for a in A:
    D[a] += 1

Dc = [0] * (M + 2)
for i in range(M + 1):
    Dc[i + 1] = Dc[i] + D[i]


ans = N * sum(A)
for a in A:
    v = 0
    for i in range(a, M + 1, a):
        v += (Dc[min(i + a, M + 1)] - Dc[i]) * (i // a)
    ans -= a * v

print(ans)
0