結果

問題 No.1233 割り切れない気持ち
ユーザー ntudantuda
提出日時 2021-10-08 22:35:54
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 478 bytes
コンパイル時間 168 ms
コンパイル使用メモリ 82,348 KB
実行使用メモリ 111,404 KB
最終ジャッジ日時 2024-07-23 05:35:43
合計ジャッジ時間 5,573 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 52 ms
65,800 KB
testcase_01 AC 50 ms
65,552 KB
testcase_02 AC 55 ms
66,060 KB
testcase_03 AC 65 ms
69,452 KB
testcase_04 AC 65 ms
69,572 KB
testcase_05 AC 56 ms
65,732 KB
testcase_06 AC 56 ms
65,060 KB
testcase_07 AC 86 ms
83,348 KB
testcase_08 AC 98 ms
92,632 KB
testcase_09 AC 118 ms
103,980 KB
testcase_10 AC 123 ms
107,572 KB
testcase_11 AC 85 ms
82,452 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 83 ms
105,524 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 80 ms
104,144 KB
testcase_21 AC 89 ms
107,568 KB
testcase_22 AC 87 ms
107,676 KB
testcase_23 AC 88 ms
107,200 KB
testcase_24 AC 87 ms
107,528 KB
testcase_25 AC 87 ms
107,332 KB
testcase_26 AC 87 ms
108,016 KB
testcase_27 AC 96 ms
110,376 KB
testcase_28 AC 95 ms
110,072 KB
testcase_29 AC 94 ms
110,140 KB
testcase_30 AC 95 ms
110,192 KB
testcase_31 AC 94 ms
110,068 KB
testcase_32 AC 94 ms
110,244 KB
testcase_33 AC 95 ms
110,428 KB
testcase_34 AC 93 ms
110,192 KB
testcase_35 AC 92 ms
110,372 KB
testcase_36 AC 94 ms
110,176 KB
testcase_37 AC 51 ms
64,976 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

for i in range(1, M+1):
    S[i] = S[i - 1] + i * D[i]
    DS[i] = DS[i - 1] + D[i]

ans = 0
for i in range(2, M):
    if D[i] > 0:
        ans += S[i - 1] * D[i]
        for j in range(1, M // i + 1):
            ans += D[i] * (S[min(i * (j + 1) - 1, M)] - S[i * j] - i * j * (DS[min(i * (j + 1) - 1, M)] - DS[i * j]))

print(ans)
0