| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1356675 | nathlol2 | 별들과 삼각형 (IZhO11_triangle) | C++20 | 63 ms | 7824 KiB |
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int N = 3e5 + 5;
int n, ans, x[N], y[N];
unordered_map<int, int> xc, yc;
signed main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> n;
for(int i = 1;i<=n;i++) cin >> x[i] >> y[i], xc[x[i]]++, yc[y[i]]++;
for(int i = 1;i<=n;i++){
ans += (xc[x[i]] - 1) * (yc[y[i]] - 1);
}
cout << ans;
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
