結果
問題 |
No.1233 割り切れない気持ち
|
ユーザー |
![]() |
提出日時 | 2020-09-19 04:06:51 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 397 bytes |
コンパイル時間 | 85 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 30,928 KB |
最終ジャッジ日時 | 2024-06-22 23:55:45 |
合計ジャッジ時間 | 22,499 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 17 WA * 22 |
ソースコード
import sys input = sys.stdin.readline N=int(input()) A=sorted(map(int,input().split())) S=sum(A) U=[0]*(2*10**5+1) for a in A: U[a]+=1 from itertools import accumulate ACC=list(accumulate(U)) ANS=0 for i in range(2*10**5+1): if U[i]==0: continue ANS+=S*U[i] for j in range(i+i-1,2*10**5+1,i): ANS-=U[i]*i*(ACC[j]-ACC[j-i])*(j//i) print(ANS)