結果

問題 No.723 2つの数の和
ユーザー morumottomorumotto
提出日時 2018-08-03 22:37:47
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 113 ms / 2,000 ms
コード長 185 bytes
コンパイル時間 125 ms
コンパイル使用メモリ 11,792 KB
実行使用メモリ 24,272 KB
最終ジャッジ日時 2023-10-19 21:29:35
合計ジャッジ時間 2,794 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,136 KB
testcase_01 AC 30 ms
10,136 KB
testcase_02 AC 29 ms
10,136 KB
testcase_03 AC 91 ms
18,640 KB
testcase_04 AC 108 ms
20,904 KB
testcase_05 AC 103 ms
19,612 KB
testcase_06 AC 111 ms
19,812 KB
testcase_07 AC 66 ms
15,032 KB
testcase_08 AC 70 ms
15,816 KB
testcase_09 AC 110 ms
21,056 KB
testcase_10 AC 63 ms
14,784 KB
testcase_11 AC 37 ms
11,476 KB
testcase_12 AC 76 ms
16,564 KB
testcase_13 AC 113 ms
21,572 KB
testcase_14 AC 50 ms
13,468 KB
testcase_15 AC 65 ms
15,224 KB
testcase_16 AC 84 ms
18,608 KB
testcase_17 AC 102 ms
19,620 KB
testcase_18 AC 54 ms
11,928 KB
testcase_19 AC 72 ms
21,652 KB
testcase_20 AC 30 ms
10,136 KB
testcase_21 AC 30 ms
10,136 KB
testcase_22 AC 30 ms
10,136 KB
testcase_23 AC 108 ms
24,272 KB
testcase_24 AC 55 ms
14,984 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter
n, x = map(int, input().split())
alst = list(map(int, input().split()))
dic = Counter(alst)
ans = 0
for k in dic:
  ans += dic[k] * dic[x - k]
print(ans)
0