# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
674047 | tato | Star triangles (IZhO11_triangle) | C++14 | 458 ms | 13360 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>
#define ll long long
using namespace std;
void answer() {
int n;
cin >> n;
vector<pair<int, int>> v;
map<int, int> mpx, mpy;
int x, y;
for(int i=1; i<=n;i++){
cin >> x>> y;
v.push_back({x, y});
mpx[x]++;
mpy[y]++;
}
ll ans=0;
for(int i=0; i<n; i++){
// cout << mpx[v[i].first] << ' ' << mpy[v[i].second] << ' ';
ans += (mpx[v[i].first] - 1) * (mpy[v[i].second]-1);
}
cout << ans;
}
int main() {
int t=1;
// cin >> t;
while(t--) {
answer();
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |