結果

問題 No.723 2つの数の和
ユーザー Poina15Poina15
提出日時 2018-09-01 18:12:25
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 108 ms / 2,000 ms
コード長 199 bytes
コンパイル時間 103 ms
コンパイル使用メモリ 11,836 KB
実行使用メモリ 24,256 KB
最終ジャッジ日時 2023-10-19 15:48:19
合計ジャッジ時間 3,474 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,120 KB
testcase_01 AC 30 ms
10,120 KB
testcase_02 AC 29 ms
10,120 KB
testcase_03 AC 88 ms
18,624 KB
testcase_04 AC 105 ms
20,888 KB
testcase_05 AC 98 ms
19,596 KB
testcase_06 AC 106 ms
19,796 KB
testcase_07 AC 62 ms
15,016 KB
testcase_08 AC 68 ms
15,800 KB
testcase_09 AC 108 ms
21,040 KB
testcase_10 AC 61 ms
14,768 KB
testcase_11 AC 36 ms
11,460 KB
testcase_12 AC 73 ms
16,548 KB
testcase_13 AC 106 ms
21,556 KB
testcase_14 AC 49 ms
13,452 KB
testcase_15 AC 63 ms
15,208 KB
testcase_16 AC 82 ms
18,592 KB
testcase_17 AC 96 ms
19,604 KB
testcase_18 AC 52 ms
11,912 KB
testcase_19 AC 71 ms
21,636 KB
testcase_20 AC 31 ms
10,120 KB
testcase_21 AC 30 ms
10,120 KB
testcase_22 AC 30 ms
10,120 KB
testcase_23 AC 104 ms
24,256 KB
testcase_24 AC 54 ms
14,968 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter
N, X = map(int, input().split())
a = list(map(int, input().split()))
counter = Counter(a)
ans = 0
for k, v in counter.items():
    ans += v * counter[X - k]
print(ans)
0