結果

問題 No.723 2つの数の和
ユーザー ryusukeryusuke
提出日時 2022-01-27 01:45:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 169 ms / 2,000 ms
コード長 193 bytes
コンパイル時間 486 ms
コンパイル使用メモリ 86,696 KB
実行使用メモリ 92,048 KB
最終ジャッジ日時 2023-08-25 15:37:12
合計ジャッジ時間 4,368 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
70,980 KB
testcase_01 AC 68 ms
70,980 KB
testcase_02 AC 70 ms
71,108 KB
testcase_03 AC 140 ms
87,180 KB
testcase_04 AC 167 ms
91,608 KB
testcase_05 AC 146 ms
89,496 KB
testcase_06 AC 169 ms
90,008 KB
testcase_07 AC 117 ms
81,408 KB
testcase_08 AC 123 ms
82,136 KB
testcase_09 AC 154 ms
92,048 KB
testcase_10 AC 123 ms
81,152 KB
testcase_11 AC 92 ms
76,876 KB
testcase_12 AC 133 ms
83,648 KB
testcase_13 AC 145 ms
91,348 KB
testcase_14 AC 97 ms
78,504 KB
testcase_15 AC 111 ms
81,820 KB
testcase_16 AC 123 ms
84,920 KB
testcase_17 AC 136 ms
89,336 KB
testcase_18 AC 126 ms
90,064 KB
testcase_19 AC 130 ms
91,272 KB
testcase_20 AC 70 ms
71,172 KB
testcase_21 AC 70 ms
70,824 KB
testcase_22 AC 71 ms
70,860 KB
testcase_23 AC 165 ms
91,188 KB
testcase_24 AC 104 ms
79,452 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect_left, bisect_right

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

print(sum(bisect_right(a, x - i) - bisect_left(a, x - i) for i in a))
0