結果

問題 No.723 2つの数の和
ユーザー ronpooronpoo
提出日時 2023-09-15 10:53:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 187 ms / 2,000 ms
コード長 181 bytes
コンパイル時間 1,295 ms
コンパイル使用メモリ 86,932 KB
実行使用メモリ 105,892 KB
最終ジャッジ日時 2023-09-15 10:53:12
合計ジャッジ時間 6,133 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
71,744 KB
testcase_01 AC 95 ms
71,576 KB
testcase_02 AC 97 ms
71,620 KB
testcase_03 AC 187 ms
93,572 KB
testcase_04 AC 144 ms
100,516 KB
testcase_05 AC 136 ms
98,604 KB
testcase_06 AC 139 ms
98,824 KB
testcase_07 AC 119 ms
85,352 KB
testcase_08 AC 118 ms
86,560 KB
testcase_09 AC 141 ms
100,384 KB
testcase_10 AC 126 ms
84,416 KB
testcase_11 AC 105 ms
77,876 KB
testcase_12 AC 126 ms
88,556 KB
testcase_13 AC 140 ms
100,152 KB
testcase_14 AC 110 ms
80,816 KB
testcase_15 AC 118 ms
85,708 KB
testcase_16 AC 126 ms
92,148 KB
testcase_17 AC 140 ms
97,416 KB
testcase_18 AC 123 ms
89,380 KB
testcase_19 AC 120 ms
91,228 KB
testcase_20 AC 93 ms
71,364 KB
testcase_21 AC 94 ms
71,652 KB
testcase_22 AC 92 ms
71,820 KB
testcase_23 AC 138 ms
105,892 KB
testcase_24 AC 114 ms
82,308 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter

N, X = map(int, input().split())
A = list(map(int, input().split()))

C = Counter(A)
ans = 0
for k, v in C.items():
    ans += v * C[X-k]
print(ans)
0