# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
552665 | KN200711 | Star triangles (IZhO11_triangle) | C++14 | 546 ms | 12232 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;
int main() {
int N;
cin>>N;
int X[N], Y[N];
map<int, int> x, y;
for(int i=0;i<N;i++) {
cin>>X[i]>>Y[i];
x[X[i]]++;
y[Y[i]]++;
}
ll ans;
ans = 0ll;
for(int i=0;i<N;i++) {
ans += (ll) (x[X[i]]-1ll) * (ll) (y[Y[i]] - 1ll);
}
cout<<ans<<endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |