結果

問題 No.723 2つの数の和
ユーザー Mr.FukuMr.Fuku
提出日時 2018-08-07 18:19:29
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 118 ms / 2,000 ms
コード長 164 bytes
コンパイル時間 256 ms
コンパイル使用メモリ 11,776 KB
実行使用メモリ 24,260 KB
最終ジャッジ日時 2023-10-19 22:29:10
合計ジャッジ時間 3,086 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,116 KB
testcase_01 AC 31 ms
10,116 KB
testcase_02 AC 30 ms
10,116 KB
testcase_03 AC 85 ms
18,632 KB
testcase_04 AC 118 ms
20,892 KB
testcase_05 AC 100 ms
19,600 KB
testcase_06 AC 108 ms
19,800 KB
testcase_07 AC 63 ms
15,020 KB
testcase_08 AC 72 ms
15,804 KB
testcase_09 AC 118 ms
21,044 KB
testcase_10 AC 59 ms
14,764 KB
testcase_11 AC 36 ms
11,464 KB
testcase_12 AC 71 ms
16,552 KB
testcase_13 AC 106 ms
21,560 KB
testcase_14 AC 45 ms
13,456 KB
testcase_15 AC 61 ms
15,216 KB
testcase_16 AC 79 ms
18,596 KB
testcase_17 AC 95 ms
19,604 KB
testcase_18 AC 64 ms
11,916 KB
testcase_19 AC 87 ms
21,640 KB
testcase_20 AC 29 ms
10,116 KB
testcase_21 AC 29 ms
10,116 KB
testcase_22 AC 29 ms
10,116 KB
testcase_23 AC 87 ms
24,260 KB
testcase_24 AC 51 ms
14,976 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter

N,X = map(int,input().split())
seq = list(map(int,input().split()))
cnt = Counter(seq)

ans = sum(cnt[X-i] for i in seq)
print(ans)
0