結果
| 問題 |
No.3128 Isosceles Triangle
|
| コンテスト | |
| ユーザー |
三価スニウム
|
| 提出日時 | 2025-04-27 11:58:23 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 247 ms / 2,500 ms |
| コード長 | 251 bytes |
| コンパイル時間 | 277 ms |
| コンパイル使用メモリ | 82,468 KB |
| 実行使用メモリ | 144,188 KB |
| 最終ジャッジ日時 | 2025-04-27 11:58:31 |
| 合計ジャッジ時間 | 7,330 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 30 |
ソースコード
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)
三価スニウム