結果

問題 No.723 2つの数の和
ユーザー simamumusimamumu
提出日時 2018-08-03 23:13:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 233 ms / 2,000 ms
コード長 495 bytes
コンパイル時間 262 ms
コンパイル使用メモリ 11,968 KB
実行使用メモリ 23,056 KB
最終ジャッジ日時 2023-10-19 21:38:32
合計ジャッジ時間 4,506 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
11,160 KB
testcase_01 AC 36 ms
11,160 KB
testcase_02 AC 36 ms
11,160 KB
testcase_03 AC 181 ms
18,708 KB
testcase_04 AC 228 ms
22,264 KB
testcase_05 AC 207 ms
21,172 KB
testcase_06 AC 214 ms
20,836 KB
testcase_07 AC 110 ms
15,636 KB
testcase_08 AC 121 ms
16,476 KB
testcase_09 AC 224 ms
22,024 KB
testcase_10 AC 105 ms
15,056 KB
testcase_11 AC 49 ms
12,032 KB
testcase_12 AC 134 ms
17,056 KB
testcase_13 AC 233 ms
22,268 KB
testcase_14 AC 76 ms
13,552 KB
testcase_15 AC 113 ms
15,588 KB
testcase_16 AC 157 ms
18,004 KB
testcase_17 AC 197 ms
20,412 KB
testcase_18 AC 177 ms
12,956 KB
testcase_19 AC 199 ms
22,664 KB
testcase_20 AC 37 ms
11,160 KB
testcase_21 AC 36 ms
11,160 KB
testcase_22 AC 36 ms
11,160 KB
testcase_23 AC 207 ms
23,056 KB
testcase_24 AC 87 ms
14,176 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
AtoZ = [chr(i) for i in range(65,65+26)]
atoz = [chr(i) for i in range(97,97+26)]

def inpl(): return list(map(int, input().split()))
def inpl_str(): return list(input().split())

N,X = inpl()
aa = inpl()
aa.sort()
ans = 0
for a in aa:
	L = bisect.bisect_left(aa,X-a)
	R = bisect.bisect_right(aa,X-a)
	ans += R-L
print(ans)
0