結果
| 問題 |
No.1233 割り切れない気持ち
|
| コンテスト | |
| ユーザー |
ayaoni
|
| 提出日時 | 2020-11-22 09:16:10 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 485 bytes |
| コンパイル時間 | 271 ms |
| コンパイル使用メモリ | 82,724 KB |
| 実行使用メモリ | 120,128 KB |
| 最終ジャッジ日時 | 2024-07-23 16:19:19 |
| 合計ジャッジ時間 | 7,297 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 17 WA * 22 |
ソースコード
import sys
from itertools import accumulate
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
N = I()
A = LI()
count = [0]*(2*10**5+1)
for a in A:
count[a] += 1
s_count = list(accumulate(count))
ans = N*sum(A)
for i in range(1,2*10**5+1):
if count[i] == 0:
continue
a = 0
for j in range(2*i-1,2*10**5+1,i):
a += j//i*(s_count[j]-s_count[j-i])
ans -= a*count[i]*i
print(ans)
ayaoni