# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1219539 | ouhdaoiuwhd | 별들과 삼각형 (IZhO11_triangle) | C++20 | 341 ms | 5840 KiB |
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
vector <int>x(n);
vector <int>y(n);
map <int,int> x1;
map <int,int> y1;
for (int i = 0; i < n; ++i){
cin >> x[i] >> y[i];
++x1[x[i]];
++y1[y[i]];
}
int ans = 0;
for (int i = 0; i < n; ++i){
ans+=(x1[x[i]] - 1) * (y1[y[i]] - 1);
}
cout << ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |