# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
724050 | groshi | Star triangles (IZhO11_triangle) | C++17 | 373 ms | 15576 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 int long long
using namespace std;
map<int,int> mapka1,mapka2;
int t[400000][2];
int32_t main()
{
cin.tie(0);
cout.tie(0);
ios_base::sync_with_stdio(0);
int n,x,y;
cin>>n;
for(int i=1;i<=n;i++)
{
cin>>x>>y;
mapka1[x]++;
mapka2[y]++;
t[i][0]=x;
t[i][1]=y;
}
int wynik=0;
for(int i=1;i<=n;i++)
{
int a=mapka1[t[i][0]];
int b=mapka2[t[i][1]];
wynik+=(a-1)*(b-1);
}
cout<<wynik;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |