結果

問題 No.723 2つの数の和
ユーザー NatsubiSoganNatsubiSogan
提出日時 2021-01-20 11:40:58
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 102 ms / 2,000 ms
コード長 166 bytes
コンパイル時間 105 ms
コンパイル使用メモリ 10,616 KB
実行使用メモリ 23,156 KB
最終ジャッジ日時 2023-08-24 14:11:18
合計ジャッジ時間 3,421 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,496 KB
testcase_01 AC 18 ms
8,416 KB
testcase_02 AC 18 ms
8,380 KB
testcase_03 AC 75 ms
18,088 KB
testcase_04 AC 94 ms
19,224 KB
testcase_05 AC 86 ms
19,204 KB
testcase_06 AC 93 ms
18,780 KB
testcase_07 AC 49 ms
13,328 KB
testcase_08 AC 54 ms
14,376 KB
testcase_09 AC 96 ms
19,388 KB
testcase_10 AC 47 ms
14,540 KB
testcase_11 AC 24 ms
9,680 KB
testcase_12 AC 61 ms
14,820 KB
testcase_13 AC 102 ms
19,828 KB
testcase_14 AC 37 ms
11,956 KB
testcase_15 AC 50 ms
14,624 KB
testcase_16 AC 68 ms
17,000 KB
testcase_17 AC 83 ms
17,708 KB
testcase_18 AC 63 ms
10,228 KB
testcase_19 AC 82 ms
20,048 KB
testcase_20 AC 18 ms
8,544 KB
testcase_21 AC 18 ms
8,572 KB
testcase_22 AC 18 ms
8,376 KB
testcase_23 AC 82 ms
23,156 KB
testcase_24 AC 40 ms
12,372 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter
n, x = map(int, input().split())
a = list(map(int, input().split()))
c = Counter(a)
ans = 0
for i in a:
    ans += c[x - i]
print(ans)
0