# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
318557 | sofapuden | Star triangles (IZhO11_triangle) | C++14 | 598 ms | 12328 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 main(){
int n; cin >> n;
map<int,int> X, Y;
vector<pair<int,int>> v(n);
for(auto &x : v){cin >> x.first >> x.second;X[x.first]++, Y[x.second]++;}
long long ans = 0;
for(int i = 0; i < n; ++i){
ans+=(X[v[i].first]-1)*(Y[v[i].second]-1);
}
cout << ans << "\n";
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |