# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
595400 | Zanite | Star triangles (IZhO11_triangle) | C++17 | 300 ms | 12192 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.
// I am now here, but I have yet to prove that I am worthy of my place here.
#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
using ll = long long;
#define fi first
#define se second
const int maxN = 3e5 + 1;
int N;
pii points[maxN];
map<int, int> X, Y;
int main() {
scanf("%d", &N);
for (int i = 1; i <= N; i++) {
scanf("%d %d", &points[i].fi, &points[i].se);
X[points[i].fi]++;
Y[points[i].se]++;
}
ll ans = 0;
for (int i = 1; i <= N; i++) {
ans += 1ll * (X[points[i].fi]-1) * (Y[points[i].se]-1);
}
printf("%lld\n", ans);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |