# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
707026 | ToroTN | Star triangles (IZhO11_triangle) | C++14 | 111 ms | 7456 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;
#define ll long long
ll n,x[300005],y[30005],cnt=0;
map<ll,ll> mp1,mp2;
int main()
{
scanf("%lld",&n);
for(int i=1;i<=n;i++)
{
scanf("%lld%lld",&x[i],&y[i]);
++mp1[x[i]],++mp2[y[i]];
}
for(int i=1;i<=n;i++)
{
cnt+=(mp1[x[i]]-1)*(mp2[y[i]]-1);
}
printf("%lld\n",cnt);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |