# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
163295 | tselmegkh | Star triangles (IZhO11_triangle) | C++14 | 1063 ms | 13580 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;
map<int, int> cntx, cnty;
int main(){
int n;
cin >> n;
vector<pair<int, int>> stars;
for(int i = 0; i < n; i++){
int x1, y1;
cin >> x1 >> y1;
stars.push_back({x1, y1});
cntx[x1]++, cnty[y1]++;
}
long long ans = 0;
for(pair<int, int> st : stars){
int x = st.first, y = st.second;
ans += (cntx[x] - 1) * (cnty[y] - 1);
}
cout << ans << '\n';
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |