結果

問題 No.723 2つの数の和
ユーザー titiatitia
提出日時 2023-05-17 07:54:34
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 134 ms / 2,000 ms
コード長 231 bytes
コンパイル時間 501 ms
コンパイル使用メモリ 10,508 KB
実行使用メモリ 22,536 KB
最終ジャッジ日時 2023-08-21 15:05:51
合計ジャッジ時間 4,890 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
8,496 KB
testcase_01 AC 88 ms
8,460 KB
testcase_02 AC 88 ms
8,464 KB
testcase_03 AC 118 ms
18,020 KB
testcase_04 AC 127 ms
19,048 KB
testcase_05 AC 123 ms
18,152 KB
testcase_06 AC 123 ms
18,744 KB
testcase_07 AC 97 ms
14,408 KB
testcase_08 AC 108 ms
15,388 KB
testcase_09 AC 134 ms
19,160 KB
testcase_10 AC 103 ms
14,012 KB
testcase_11 AC 92 ms
9,680 KB
testcase_12 AC 110 ms
14,732 KB
testcase_13 AC 134 ms
19,680 KB
testcase_14 AC 97 ms
11,652 KB
testcase_15 AC 106 ms
14,392 KB
testcase_16 AC 118 ms
17,856 KB
testcase_17 AC 123 ms
17,816 KB
testcase_18 AC 109 ms
9,988 KB
testcase_19 AC 125 ms
19,684 KB
testcase_20 AC 85 ms
8,412 KB
testcase_21 AC 84 ms
8,588 KB
testcase_22 AC 83 ms
8,588 KB
testcase_23 AC 109 ms
22,536 KB
testcase_24 AC 102 ms
13,276 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,X=map(int,input().split())
A=list(map(int,input().split()))

from collections import Counter
C=Counter(A)

ANS=0
for i in range(10**5+1):
    k=X-i

    if k==i:
        ANS+=C[i]*C[i]
    else:
        ANS+=C[i]*C[k]

print(ANS)
0