結果

問題 No.723 2つの数の和
ユーザー daku9640daku9640
提出日時 2018-08-03 23:09:49
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 196 bytes
コンパイル時間 81 ms
コンパイル使用メモリ 11,756 KB
実行使用メモリ 27,824 KB
最終ジャッジ日時 2023-10-19 21:37:50
合計ジャッジ時間 2,550 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,028 KB
testcase_01 AC 29 ms
10,028 KB
testcase_02 AC 29 ms
10,028 KB
testcase_03 AC 80 ms
20,580 KB
testcase_04 AC 100 ms
22,288 KB
testcase_05 AC 91 ms
21,688 KB
testcase_06 AC 97 ms
21,972 KB
testcase_07 AC 61 ms
15,544 KB
testcase_08 AC 62 ms
15,992 KB
testcase_09 AC 95 ms
22,372 KB
testcase_10 AC 57 ms
15,404 KB
testcase_11 AC 35 ms
11,200 KB
testcase_12 AC 65 ms
16,292 KB
testcase_13 AC 91 ms
22,616 KB
testcase_14 AC 44 ms
12,960 KB
testcase_15 AC 55 ms
15,680 KB
testcase_16 AC 70 ms
19,996 KB
testcase_17 AC 84 ms
21,464 KB
testcase_18 AC 53 ms
11,188 KB
testcase_19 AC 67 ms
17,680 KB
testcase_20 AC 29 ms
10,028 KB
testcase_21 AC 29 ms
10,028 KB
testcase_22 AC 29 ms
10,028 KB
testcase_23 AC 127 ms
27,824 KB
testcase_24 AC 48 ms
14,632 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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