結果

問題 No.723 2つの数の和
ユーザー daku9640daku9640
提出日時 2018-08-04 00:58:54
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 103 ms / 2,000 ms
コード長 168 bytes
コンパイル時間 337 ms
コンパイル使用メモリ 11,696 KB
実行使用メモリ 27,836 KB
最終ジャッジ日時 2023-10-19 21:41:34
合計ジャッジ時間 2,757 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,040 KB
testcase_01 AC 29 ms
10,040 KB
testcase_02 AC 30 ms
10,040 KB
testcase_03 AC 74 ms
20,592 KB
testcase_04 AC 96 ms
22,300 KB
testcase_05 AC 82 ms
21,700 KB
testcase_06 AC 88 ms
21,984 KB
testcase_07 AC 53 ms
15,564 KB
testcase_08 AC 56 ms
16,004 KB
testcase_09 AC 88 ms
22,388 KB
testcase_10 AC 53 ms
15,416 KB
testcase_11 AC 33 ms
11,212 KB
testcase_12 AC 61 ms
16,304 KB
testcase_13 AC 92 ms
22,628 KB
testcase_14 AC 44 ms
12,980 KB
testcase_15 AC 56 ms
15,692 KB
testcase_16 AC 69 ms
20,008 KB
testcase_17 AC 83 ms
21,476 KB
testcase_18 AC 53 ms
11,200 KB
testcase_19 AC 68 ms
17,692 KB
testcase_20 AC 29 ms
10,040 KB
testcase_21 AC 29 ms
10,040 KB
testcase_22 AC 29 ms
10,040 KB
testcase_23 AC 103 ms
27,836 KB
testcase_24 AC 46 ms
14,644 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter
n, x = map(int, input().split())
c = Counter(map(int, input().split()))
print(sum(c[k] * c[x - k] for k, v in c.items() if x - k in c))
0