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