aboutsummaryrefslogtreecommitdiff
path: root/contests/filtrationContest/C/main.cpp
blob: e3ed80c47d8ef63aa1928072cf06cc7f993ca466 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include<bits/stdc++.h>
 
using namespace std;
 
int main () {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  long long ans = 0;
  map<long long, long long> fq;
  for(int i = 0; i < n; i++) {
    long long x;
    cin >> x;
    ans += fq[x];
    fq[-x]++;
  }
  cout << ans << '\n';
}