結果

問題 No.723 2つの数の和
ユーザー eQe
提出日時 2020-05-05 22:51:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 105 ms / 2,000 ms
コード長 386 bytes
コンパイル時間 250 ms
コンパイル使用メモリ 82,160 KB
実行使用メモリ 106,384 KB
最終ジャッジ日時 2024-06-27 06:39:32
合計ジャッジ時間 3,243 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

import cmath
import sys
from collections import deque, defaultdict
from heapq import heappop,heappush
from copy import deepcopy

INF=10**18
MOD=10**9+7
MAX=10**5+7

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

  mp=defaultdict(int)
  for a in A:
    mp[a]+=1

  ans=0
  for a in A:
    ans+=mp[X-a]

  print(ans)


if __name__=='__main__':
    main()
0