結果
| 問題 | 
                            No.723 2つの数の和
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2020-08-21 17:59:54 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                RE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 235 bytes | 
| コンパイル時間 | 98 ms | 
| コンパイル使用メモリ | 12,416 KB | 
| 実行使用メモリ | 20,876 KB | 
| 最終ジャッジ日時 | 2024-10-15 04:51:03 | 
| 合計ジャッジ時間 | 2,981 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 13 RE * 9 | 
ソースコード
from bisect import *
N,X = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
ans = 0
for i in range(N):
  b = bisect_left(A,X-A[i])
  if A[i]+A[b] == X:
    br = bisect_right(A,X-A[i])
    ans += (br-b)
print(ans)