# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
975577 | vjudge1 | Star triangles (IZhO11_triangle) | C++17 | 496 ms | 32016 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;
map <int, ll> X, Y;
map <ll, bool> test;
int x[300005] = {}, y[300005] = {};
int main() {
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int N;
cin >> N;
ll ans = 0;
for (int i = 0; i < N; i++) {
cin >> x[i] >> y[i];
ll t = (ll)(1e9 + 5) * (ll)(x[i]) + (ll)(y[i]);
if (test[t])
continue;
X[x[i]]++; Y[y[i]]++;
test[t] = 1;
}
for (int i = 0; i < N; i++)
ans += (X[x[i]] - 1) * (Y[y[i]] - 1);
cout << ans << '\n';
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |