結果

問題 No.3128 Isosceles Triangle
ユーザー 回転
提出日時 2025-04-25 21:42:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 334 ms / 2,500 ms
コード長 281 bytes
コンパイル時間 414 ms
コンパイル使用メモリ 82,372 KB
実行使用メモリ 176,324 KB
最終ジャッジ日時 2025-04-25 21:43:17
合計ジャッジ時間 7,622 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect
from collections import Counter
from math import comb
N = int(input())
A = sorted(list(map(int,input().split())))

ac = Counter(A)
ans = 0
for i in ac:
    if(ac[i] >= 2):
        MAX = i*2
        ans += comb(ac[i],2) * (bisect.bisect_left(A,MAX) - ac[i])
print(ans)
0