# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
523162 | Pety | Star triangles (IZhO11_triangle) | C++14 | 330 ms | 12252 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 INF = 1e9;
const int MOD = 1e9 + 7;
map<int, int>X;
map<int, int>Y;
int x[300002], y[300002], n;
int main ()
{
ios_base::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> x[i] >> y[i];
X[x[i]]++;
Y[y[i]]++;
}
long long ans = 0;
for (int i = 1; i <= n; i++) {
ans += 1ll * (X[x[i]] - 1) * (Y[y[i]] - 1);
}
cout << ans;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |