# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
336088 | tevdore | Star triangles (IZhO11_triangle) | C++14 | 636 ms | 6180 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;
const int N = 3e5 + 10;
int n;
int x[N], y[N];
map < int, int > f1, f2;
ll ans;
main() {
cin >> n;
for(int i = 1; i <= n; i++) {
cin >> x[i] >> y[i];
f1[x[i]]++;
f2[y[i]]++;
}
for(int i = 1; i <= n; i++) ans += (ll)(f1[x[i]] - 1) * (f2[y[i]] - 1);
cout << ans << "\n";
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |