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
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
3 votes
Tags:
ObservationBasic MathAlgorithmsBasics of Greedy AlgorithmsMath
Points:20
10 votes
Tags:
ImplementationMath BasicBasics of ImplementationC++Basic MathMathGame Theory
Points:20
11 votes
Tags:
MathematicsOpenApprovedEasyMathamatics
Editorial
Login to unlock the editorial