# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1110797 | HasanV11010238 | Star triangles (IZhO11_triangle) | C++17 | 735 ms | 39148 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;
#define ld long double
#define ll long long
int main(){
int n, x, y;
cin>>n;
set<vector<int>> se;
for (int i = 0; i < n; i++){
cin>>x>>y;
se.insert({x, y});
}
map<int, ll> mx, my;
for (auto el : se){
mx[el[0]]++;
my[el[1]]++;
}
ll ans = 0;
for (auto el : se){
ans += (mx[el[0]] - 1) * (my[el[1]] - 1);
}
cout<<ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |