結果

問題 No.723 2つの数の和
ユーザー Meso Meso
提出日時 2025-01-11 20:44:54
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 148 ms / 2,000 ms
コード長 251 bytes
コンパイル時間 604 ms
コンパイル使用メモリ 11,648 KB
実行使用メモリ 25,500 KB
最終ジャッジ日時 2025-01-11 20:45:01
合計ジャッジ時間 4,200 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

n, x = map(int, input().split())
A = list(map(int, input().split()))

dict = {}

for a in A:
    if x - a not in dict:
        dict[x - a] = 1
    else:
        dict[x - a] += 1

cnt = 0
for a in A:
    if a in dict:
        cnt += dict[a]

print(cnt)
0