結果
問題 |
No.1233 割り切れない気持ち
|
ユーザー |
|
提出日時 | 2025-10-14 13:38:30 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 265 ms / 3,153 ms |
コード長 | 359 bytes |
コンパイル時間 | 342 ms |
コンパイル使用メモリ | 82,820 KB |
実行使用メモリ | 148,060 KB |
最終ジャッジ日時 | 2025-10-14 13:38:39 |
合計ジャッジ時間 | 8,103 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 39 |
ソースコード
n=int(input()) x=[0]*(5*10**5+1) a=list(map(int,input().split()));ans=0;v=sum(a) s=set();z={} for i in range(n): x[a[i]]+=1 s.add(a[i]) if a[i] not in z: z[a[i]]=0 z[a[i]]+=1 for i in range(1,10**5*5): x[i]+=x[i-1] for i in list(s): c=v*z[i] for j in range(10**5*5//i): c-=(x[min(5*10**5,(j+1)*i-1)]-x[max(0,j*i-1)])*z[i]*(i*j) ans+=c print(ans)