# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1219568 | nataliaa | Star triangles (IZhO11_triangle) | C++20 | 374 ms | 9208 KiB |
#include<bits/stdc++.h>
using namespace std;
#define int long long
void test_case() {
int n;
cin >> n;
pair<int,int> p[n];
int ans = 0;
map<int, int> x, y;
for(int i = 0; i < n ; i++) {
cin >> p[i].first >>p[i].second;
x[p[i].first]++;
y[p[i].second]++;
}
for(int i = 0; i < n ; i++) {
ans+=(x[p[i].first]-1)*(y[p[i].second]-1);
}
cout << ans;
}
signed main() {
int t;
t=1;
while(t--) test_case();
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |