結果
| 問題 |
No.1233 割り切れない気持ち
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-09-19 13:37:08 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 532 bytes |
| コンパイル時間 | 379 ms |
| コンパイル使用メモリ | 82,516 KB |
| 実行使用メモリ | 113,420 KB |
| 最終ジャッジ日時 | 2024-06-23 13:06:10 |
| 合計ジャッジ時間 | 20,434 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 2 |
| other | WA * 34 OLE * 5 |
ソースコード
n=int(input())
a=list(map(int,input().split()))
a.sort()
from bisect import bisect_left,bisect_right
ans=0
d=dict()
for i in range(n):
if a[i] in d:
ans+=d[a[i]]
continue
ans_sub=0
j=i
#print(i)
while j!=n:
x=a[j]//a[i]
b=bisect_left(a,(x+1)*a[i],lo=j)-1
#print((x+1)*a[i])
#print(j,b)
print(j,x,b-j+1)
ans_sub+=(x*(b-j+1)*a[i])
j=b+1
#print(j,b)
d[a[i]]=ans_sub
ans+=ans_sub
#print(sum(a)*n)
#print(ans)
print(sum(a)*n-ans)