結果

問題 No.3128 Isosceles Triangle
コンテスト
ユーザー titia
提出日時 2025-04-25 22:21:26
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 309 ms / 2,500 ms
コード長 362 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 218 ms
コンパイル使用メモリ 96,228 KB
実行使用メモリ 180,992 KB
最終ジャッジ日時 2026-07-10 07:16:49
合計ジャッジ時間 7,457 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys
input = sys.stdin.readline

from collections import Counter
from bisect import bisect_left

N=int(input())
A=list(map(int,input().split()))

A.sort()

C=Counter(A)


ANS=0

for i in range(len(A)):
    if i>=1 and A[i]==A[i-1]:
        continue
    a=A[i]
    x=bisect_left(A,a*2)

    c=C[a]
    ANS+=c*(c-1)//2 * (x-c)

    #print(a,ANS)

print(ANS)
0