# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
547819 | racsosabe | Star triangles (IZhO11_triangle) | C++14 | 309 ms | 13344 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int n;
map<int, int> X;
map<int, int> Y;
int main(){
scanf("%d", &n);
vector<pair<int, int>> v;
for(int i = 0; i < n; i++){
int x, y;
scanf("%d %d", &x, &y);
X[x]++;
Y[y]++;
v.emplace_back(make_pair(x, y));
}
long long ans = 0;
for(auto e : v){
ans += 1ll * (X[e.first] - 1) * (Y[e.second] - 1);
}
printf("%lld\n", ans);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |