# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1100556 | vjudge1 | Star triangles (IZhO11_triangle) | C++17 | 206 ms | 5376 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;
int main() {
int n;
cin>>n;
unordered_map<int, int> cntx, cnty;
pair<int, int> stars[n];
for (int i = 0; i < n; i++) {
int x, y;
cin>>x>>y;
stars[i] = {x, y};
cntx[x]++;
cnty[y]++;
}
ll total = 0;
for (int i = 0; i < n; i++) {
int x = stars[i].first;
int y = stars[i].second;
total += (cntx[x]-1) * (cnty[y]-1);
}
cout<<total<<endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |