結果

問題 No.3128 Isosceles Triangle
コンテスト
ユーザー 三価スニウム
提出日時 2025-04-27 11:58:23
言語 PyPy3
(8.0.1 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 175 ms / 2,500 ms
+ 495µs
コード長 251 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 80 ms
コンパイル使用メモリ 63,956 KB
実行使用メモリ 112,116 KB
最終ジャッジ日時 2026-11-12 03:02:04
合計ジャッジ時間 6,596 ms
ジャッジサーバーID
(参考情報)
judge5_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import bisect
import collections

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

A.sort()
ans = 0
for l, n in collections.Counter(A).items():
    if n >= 2:
        m = bisect.bisect(A, l*2-1) - n
        ans += m * n * (n-1) // 2
print(ans)
0