| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1346649 | killerzaluu | 별들과 삼각형 (IZhO11_triangle) | C++20 | 248 ms | 9224 KiB |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
vector<pair<long long,long long>> a(n);
map<long long,long long> cntx, cnty;
for (int i = 0; i < n; i++) {
cin >> a[i].first >> a[i].second;
cntx[a[i].first]++;
cnty[a[i].second]++;
}
long long ans = 0;
for (int i = 0; i < n; i++) {
long long x = a[i].first;
long long y = a[i].second;
ans += (cntx[x] - 1) * (cnty[y] - 1);
}
cout << ans << '\n';
return 0;
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
