結果

問題 No.723 2つの数の和
ユーザー ryusuke
提出日時 2022-01-27 01:44:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 152 ms / 2,000 ms
コード長 236 bytes
コンパイル時間 373 ms
コンパイル使用メモリ 81,792 KB
実行使用メモリ 90,624 KB
最終ジャッジ日時 2024-12-24 00:20:34
合計ジャッジ時間 3,878 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect_left, bisect_right

n, x = map(int, input().split())
a = sorted(list(map(int, input().split())))

ans = 0
for i in a:
    if x - i >= 0:
        ans += bisect_right(a, x - i) - bisect_left(a, x - i)

print(ans)
0