Find Pair
Practice
2.5 (11 votes)
Basic programming
Open
Approved
Easy
Hash function
Mathamatics
Problem
69% Success 6417 Attempts 20 Points 5s Time Limit 256MB Memory 1024 KB Max Code
Given an array A having N elements. Find total number of pairs (i,j) such that j < i and Aj = Ai.
Input:
First line of input contains N, size of array A. Next line contains N space separated elements of array A.
Output:
Print the required answer.
Constraints:
1 ≤ N ≤ 105
0 ≤ Ai ≤ 105
Submissions
Please login to view your submissions
Similar Problems
Points:20
5 votes
Tags:
MathematicsOpenEasyMathematicsMathamatics
Points:20
39 votes
Tags:
C++Math BasicBasic MathMath
Points:20
6 votes
Tags:
ImplementationBasic ProgrammingAd-HocEasyMathematicsOpenApprovedMathamatics
Editorial