結果
問題 |
No.2517 Right Triangles on Circle
|
ユーザー |
|
提出日時 | 2024-11-08 17:34:18 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 243 ms / 2,000 ms |
コード長 | 280 bytes |
コンパイル時間 | 235 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 129,608 KB |
最終ジャッジ日時 | 2024-11-08 17:34:27 |
合計ジャッジ時間 | 5,740 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 29 |
ソースコード
from bisect import bisect_left N,M = map(int,input().split()) A = sorted(list(map(int,input().split()))) ans = 0 if M%2==0: for i in range(N): if A[i]>M//2:break j = bisect_left(A,A[i]+M//2) if j<N and A[j]==A[i]+M//2: ans += N-2 print(ans)