report VI VI EN
Register | Login
  • HOME
  • PROBLEMSET
  • ROADMAP
  • COMPETITION
  • TOPIC
  • RANKING
  • GUIDE
  • MASHUP
  • ABOUT
  • CONTACT
  • Problem
  • Submit
  • Results
Unammed - FlandreOJ: Flandre Online Judge

Unammed

Time limit: 1000 ms
Memory limit: 256 MB
Given two arrays $A$ and $B$, both consisting of $n$ integers, and an integer $x$. Count the number of pairs $i, j$ such that $A_i + B_j = x$. ### Input - The first line consists of two integers $n, x$. - The second line contains $n$ integers $A_i$. - The third line contains $n$ integers $B_i$. ### Output - Output an integer as the answer. ### Constraints - $1 \le n \le 10^5$. - $0 \le |A_i|,|B_i|,x \le 10^9$. ### Sample test Input ``` 5 6 1 2 3 9 10 -3 5 3 2 1 ``` Output: ``` 3 ```
Containers C++ in Standard Template Library (STL)
k-th element
Dynamic prefix sum
Unammed
k-th occurence
Set
Most frequent value
A lot of queries
Median
Houses
Picking flowers
Topic
STL
Rating 900
Solution (1) Solution