# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
597196 | Trisanu_Das | Star triangles (IZhO11_triangle) | C++17 | 462 ms | 15584 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 int long long
signed main(){
int n; cin >> n;
pair<int, int> points[n]; map<int, int> X, Y;
for(int i = 0; i < n; i++){
cin >> points[i].first >> points[i].second;
X[points[i].first]++; Y[points[i].second]++;
}
int ans = 0;
for(int i = 0; i < n; i++) ans += (X[points[i].first] - 1) * (Y[points[i].second] - 1);
cout << ans << '\n';
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |