結果

問題 No.723 2つの数の和
ユーザー daleksprinter
提出日時 2018-08-09 08:22:53
言語 Python2
(2.7.18)
結果
AC  
実行時間 215 ms / 2,000 ms
コード長 198 bytes
コンパイル時間 450 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 14,968 KB
最終ジャッジ日時 2024-09-23 04:17:53
合計ジャッジ時間 4,571 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect
n,x = map(int,raw_input().split())

arr = map(int,raw_input().split())

arr.sort()
ans = 0

for i in arr:
	ans += bisect.bisect_right(arr,x-i) - bisect.bisect_left(arr,x-i) 

print ans
0