# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
976650 | vjudge1 | Star triangles (IZhO11_triangle) | C++17 | 453 ms | 17016 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;
using ll = long long;
int main() {
map<ll, int> datx;
map<ll, int> daty;
int n; cin >> n;
vector <pair<ll, ll>> titik;
for (int i=0;i<n;i++) {
ll x, y; cin >> x >> y;
titik.push_back({x, y});
datx[x]++;
daty[y]++;
}
ll ans = 0;
for (auto i:titik) {
ans+= (datx[i.first]-1)*(daty[i.second]-1);
}
cout << ans << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |