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
Code Editor
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
Submissions
Please login to view your submissions
Similar Problems
Points:20
10 votes
Tags:
OpenAlgorithmsApprovedEasy
2.Bee
Points:20
1 votes
Points:20
2 votes
Tags:
MathObservationBasic MathC++
Editorial
Login to unlock the editorial
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