# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
320029 | kingfran1907 | Star triangles (IZhO11_triangle) | C++14 | 469 ms | 12260 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 X first
#define Y second
using namespace std;
typedef long long llint;
const int maxn = 3e5+10;
const int base = 31337;
const int mod = 1e9+7;
const int inf = 0x3f3f3f3f;
const int logo = 20;
const int off = 1 << logo;
const int treesiz = off << 1;
int n;
int x[maxn], y[maxn];
map<int, int> xs, ys;
int main() {
scanf("%d", &n);
for (int i = 0; i < n; i++) {
scanf("%d%d", x+i, y+i);
xs[x[i]]++;
ys[y[i]]++;
}
llint sol = 0;
for (int i = 0; i < n; i++) {
sol += (llint)(xs[x[i]] - 1) * (ys[y[i]] - 1);
}
printf("%lld\n", sol);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |