# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1257710 | islam_2010 | Star triangles (IZhO11_triangle) | C++20 | 190 ms | 7808 KiB |
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int sz = 2005;
signed main(){
int n;
cin >> n;
int a[n], b[n];
unordered_map<int, int> mpa, mpb;
for(int i = 0; i < n; i++){
cin >> a[i] >> b[i];
mpa[a[i]]++;
mpb[b[i]]++;
}int ans = 0;
for(int i = 0; i < n; i++){
ans += (mpa[a[i]]-1) * (mpb[b[i]]-1);
}cout << ans << endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |