結果

問題 No.723 2つの数の和
ユーザー daleksprinterdaleksprinter
提出日時 2018-08-09 08:22:53
言語 Python2
(2.7.18)
結果
AC  
実行時間 215 ms / 2,000 ms
コード長 198 bytes
コンパイル時間 638 ms
コンパイル使用メモリ 7,148 KB
実行使用メモリ 15,068 KB
最終ジャッジ日時 2023-10-24 11:58:20
合計ジャッジ時間 4,912 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
6,428 KB
testcase_01 AC 11 ms
6,428 KB
testcase_02 AC 10 ms
6,428 KB
testcase_03 AC 161 ms
12,336 KB
testcase_04 AC 209 ms
14,340 KB
testcase_05 AC 187 ms
13,688 KB
testcase_06 AC 199 ms
14,112 KB
testcase_07 AC 89 ms
9,768 KB
testcase_08 AC 100 ms
10,056 KB
testcase_09 AC 213 ms
14,624 KB
testcase_10 AC 83 ms
9,500 KB
testcase_11 AC 26 ms
7,068 KB
testcase_12 AC 115 ms
10,852 KB
testcase_13 AC 215 ms
15,020 KB
testcase_14 AC 54 ms
8,252 KB
testcase_15 AC 90 ms
9,900 KB
testcase_16 AC 134 ms
11,756 KB
testcase_17 AC 179 ms
13,440 KB
testcase_18 AC 167 ms
7,852 KB
testcase_19 AC 179 ms
15,068 KB
testcase_20 AC 11 ms
6,428 KB
testcase_21 AC 12 ms
6,428 KB
testcase_22 AC 11 ms
6,428 KB
testcase_23 AC 186 ms
15,064 KB
testcase_24 AC 64 ms
8,640 KB
権限があれば一括ダウンロードができます

ソースコード

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