MCPcopy Create free account
hub / github.com/Vishruth-S/CompetitiveCode / main

Function main

Hackerrank_problems/Pairs/solution.cpp:21–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19typedef map<pll,ll> mpll;
20typedef map<ll,ll> mll;
21int main()
22{
23 ll n,k;
24 cin>>n>>k;
25 vll a(n);
26 mll hash;
27 mpll pairHash;
28 vpll result;
29 for(auto &i:a)cin>>i,hash[i]=1;
30 for(auto &i:a){
31 if(hash.find(k+i)!=hash.end()){
32 result.pb(mp(k+i,i));
33 }
34 }
35 cout<<result.size();
36}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected