only half of the test cases pass when i traverse through unordered_map, but when i use vector all of them pass, is there any mistake in my code?
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n; cin>>n;
unordered_map<int,int> mp;
vector<int> v; v.reserve(n);
while(n--)
{
int x,y; cin>>x>>y;
int h=y+x;
if(mp[h]==0){ v.push_back(h); }
mp[h]++;
}
int s; cin>>s; int sa=0;
for(auto i:mp)
{
int j=i.first+s;
long long u=mp[j]*(i.second);
sa=sa+u;
}
cout<<sa;
}
if(mp[h]==0)