# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
382266 | ritul_kr_singh | Star triangles (IZhO11_triangle) | C++17 | 446 ms | 9068 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
#define sp << " " <<
#define nl << "\n"
signed main(){
cin.tie(0)->sync_with_stdio(0);
map<int, int> x, y;
int n; cin >> n;
pair<int, int> a[n];
for(auto &i : a) cin >> i.first >> i.second, ++x[i.first], ++y[i.second];
int ans = 0;
for(auto i : a) ans += (x[i.first]-1LL)*(y[i.second]-1LL);
cout << ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |