結果

問題 No.3128 Isosceles Triangle
ユーザー miho-4
提出日時 2025-04-25 21:56:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 292 ms / 2,500 ms
コード長 256 bytes
コンパイル時間 488 ms
コンパイル使用メモリ 82,052 KB
実行使用メモリ 173,972 KB
最終ジャッジ日時 2025-04-25 21:56:37
合計ジャッジ時間 7,195 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
import bisect
n=int(input())
L=list(map(int,input().split()))
L.sort()
D=defaultdict(int)
for e in L:
	D[e]+=1

ans=0
for k,v in D.items():
	if 2<=v:
		id=bisect.bisect_left(L,k*2)
		ans+=(v*(v-1)//2) * (id-v)
print(ans)
0