結果

問題 No.723 2つの数の和
ユーザー shobonvipshobonvip
提出日時 2022-03-12 14:53:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 162 ms / 2,000 ms
コード長 195 bytes
コンパイル時間 339 ms
コンパイル使用メモリ 86,996 KB
実行使用メモリ 109,452 KB
最終ジャッジ日時 2023-10-15 04:03:07
合計ジャッジ時間 6,155 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 103 ms
71,592 KB
testcase_01 AC 102 ms
71,728 KB
testcase_02 AC 101 ms
71,480 KB
testcase_03 AC 144 ms
99,332 KB
testcase_04 AC 159 ms
105,576 KB
testcase_05 AC 156 ms
105,656 KB
testcase_06 AC 152 ms
103,908 KB
testcase_07 AC 132 ms
90,224 KB
testcase_08 AC 136 ms
91,856 KB
testcase_09 AC 161 ms
107,604 KB
testcase_10 AC 129 ms
89,128 KB
testcase_11 AC 119 ms
78,920 KB
testcase_12 AC 136 ms
94,672 KB
testcase_13 AC 162 ms
109,452 KB
testcase_14 AC 122 ms
84,368 KB
testcase_15 AC 129 ms
91,752 KB
testcase_16 AC 143 ms
99,764 KB
testcase_17 AC 150 ms
105,832 KB
testcase_18 AC 124 ms
89,648 KB
testcase_19 AC 127 ms
91,616 KB
testcase_20 AC 100 ms
71,708 KB
testcase_21 AC 100 ms
71,660 KB
testcase_22 AC 100 ms
71,568 KB
testcase_23 AC 146 ms
105,788 KB
testcase_24 AC 128 ms
86,784 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict

n,x = map(int,input().split())
a = list(map(int,input().split()))
b = defaultdict(int)
ans = 0

for i in a:
	b[i] += 1

for i in a:
	ans += b[x-i]

print(ans)
0