# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
679964 | Hacv16 | Star triangles (IZhO11_triangle) | C++17 | 486 ms | 15484 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;
typedef long long ll;
const int MAX = 2e6 + 15;
ll n, x[MAX], y[MAX], ans;
map<ll, ll> fx, fy;
int main(void){
cin >> n;
for(int i = 1; i <= n; i++){
cin >> x[i] >> y[i];
fx[x[i]]++; fy[y[i]]++;
}
for(int i = 1; i <= n; i++)
ans += (fx[x[i]] - 1) * (fy[y[i]] - 1);
cout << ans << '\n';
exit(0);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |