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