結果

問題 No.723 2つの数の和
ユーザー 双六双六
提出日時 2019-04-06 08:09:27
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 121 ms / 2,000 ms
コード長 229 bytes
コンパイル時間 156 ms
コンパイル使用メモリ 10,676 KB
実行使用メモリ 23,268 KB
最終ジャッジ日時 2023-09-05 17:43:33
合計ジャッジ時間 3,240 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,424 KB
testcase_01 AC 18 ms
8,552 KB
testcase_02 AC 18 ms
8,536 KB
testcase_03 AC 97 ms
22,032 KB
testcase_04 AC 114 ms
22,880 KB
testcase_05 AC 110 ms
22,992 KB
testcase_06 AC 112 ms
23,092 KB
testcase_07 AC 65 ms
16,412 KB
testcase_08 AC 68 ms
16,708 KB
testcase_09 AC 119 ms
22,952 KB
testcase_10 AC 60 ms
16,820 KB
testcase_11 AC 28 ms
10,296 KB
testcase_12 AC 75 ms
16,944 KB
testcase_13 AC 121 ms
23,036 KB
testcase_14 AC 44 ms
13,196 KB
testcase_15 AC 64 ms
16,596 KB
testcase_16 AC 86 ms
21,224 KB
testcase_17 AC 106 ms
21,284 KB
testcase_18 AC 53 ms
10,256 KB
testcase_19 AC 70 ms
20,048 KB
testcase_20 AC 18 ms
8,600 KB
testcase_21 AC 17 ms
8,460 KB
testcase_22 AC 18 ms
8,420 KB
testcase_23 AC 117 ms
23,268 KB
testcase_24 AC 52 ms
15,468 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict

N, X = list(map(int, input().split()))
a = list(map(int, input().split()))
D = defaultdict(int)

for i in range(N):
	D[a[i]] += 1

ans = 0
for i in list(D):
	ans += D[i] * D[X - i]

print(ans)
0