結果

問題 No.723 2つの数の和
ユーザー eQeeQe
提出日時 2020-05-05 22:51:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 169 ms / 2,000 ms
コード長 386 bytes
コンパイル時間 1,322 ms
コンパイル使用メモリ 86,920 KB
実行使用メモリ 109,864 KB
最終ジャッジ日時 2023-09-09 13:42:50
合計ジャッジ時間 5,441 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 107 ms
72,436 KB
testcase_01 AC 107 ms
72,580 KB
testcase_02 AC 106 ms
72,584 KB
testcase_03 AC 169 ms
99,656 KB
testcase_04 AC 155 ms
105,604 KB
testcase_05 AC 154 ms
105,860 KB
testcase_06 AC 154 ms
104,320 KB
testcase_07 AC 143 ms
90,728 KB
testcase_08 AC 135 ms
92,700 KB
testcase_09 AC 157 ms
101,596 KB
testcase_10 AC 135 ms
89,688 KB
testcase_11 AC 118 ms
78,840 KB
testcase_12 AC 139 ms
95,756 KB
testcase_13 AC 159 ms
109,864 KB
testcase_14 AC 125 ms
84,564 KB
testcase_15 AC 133 ms
92,612 KB
testcase_16 AC 144 ms
99,780 KB
testcase_17 AC 151 ms
106,148 KB
testcase_18 AC 127 ms
90,488 KB
testcase_19 AC 128 ms
91,696 KB
testcase_20 AC 105 ms
72,584 KB
testcase_21 AC 104 ms
72,892 KB
testcase_22 AC 106 ms
72,636 KB
testcase_23 AC 146 ms
106,236 KB
testcase_24 AC 129 ms
87,364 KB
権限があれば一括ダウンロードができます

ソースコード

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