# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
229367 | DodgeBallMan | Star triangles (IZhO11_triangle) | C++14 | 462 ms | 13304 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>
using namespace std;
const int N = 3e5 + 10;
int n, x[N], y[N];
map<int, long long> m1, m2;
long long ans;
int main()
{
scanf("%d",&n);
for( int i = 1 ; i <= n ; i++ ) {
scanf("%d %d",&x[i],&y[i]);
m1[x[i]]++, m2[y[i]]++;
}
for( int i = 1 ; i <= n ; i++ ) ans += ( m1[x[i]] - 1 ) * ( m2[y[i]] - 1 );
printf("%lld",ans);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |