結果

問題 No.723 2つの数の和
ユーザー roarisroaris
提出日時 2019-08-28 19:24:09
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 181 bytes
コンパイル時間 389 ms
コンパイル使用メモリ 87,020 KB
実行使用メモリ 105,752 KB
最終ジャッジ日時 2023-08-11 03:46:26
合計ジャッジ時間 4,887 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
71,632 KB
testcase_01 AC 77 ms
71,452 KB
testcase_02 AC 78 ms
71,372 KB
testcase_03 AC 112 ms
93,520 KB
testcase_04 AC 121 ms
100,196 KB
testcase_05 AC 117 ms
98,564 KB
testcase_06 AC 120 ms
98,484 KB
testcase_07 AC 100 ms
84,956 KB
testcase_08 AC 99 ms
86,408 KB
testcase_09 AC 119 ms
100,184 KB
testcase_10 AC 101 ms
84,284 KB
testcase_11 AC 92 ms
77,764 KB
testcase_12 AC 106 ms
88,672 KB
testcase_13 AC 119 ms
100,156 KB
testcase_14 AC 93 ms
81,004 KB
testcase_15 AC 101 ms
85,632 KB
testcase_16 AC 105 ms
92,332 KB
testcase_17 AC 112 ms
97,328 KB
testcase_18 AC 101 ms
89,536 KB
testcase_19 AC 103 ms
91,488 KB
testcase_20 AC 82 ms
71,484 KB
testcase_21 AC 82 ms
71,488 KB
testcase_22 AC 83 ms
71,628 KB
testcase_23 AC 123 ms
105,752 KB
testcase_24 AC 99 ms
82,364 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter

N, X = map(int, input().split())
a = list(map(int, input().split()))
d = Counter(a)
ans = 0

for k in d.keys():
    ans += d[k] * d[X-k]

print(ans)
0