# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
53661 | sven | Star triangles (IZhO11_triangle) | C++14 | 2 ms | 720 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;
long long h[100001LL];
long long v[100001LL];
int main()
{
long long nb;
cin>>nb;
long long tab[nb][2LL];
for (long long i=0LL;i<nb;i+=1LL)
{
cin>>tab[i][0LL]>>tab[i][1LL];
h[tab[i][0LL]]+=1LL;
v[tab[i][1LL]]+=1LL;
}
long long total=0LL;
for (long long i=0LL;i<nb;i+=1LL)
{
long long in=((h[tab[i][0LL]]-1LL)*(v[tab[i][1LL]]-1LL));
if (in>0LL)
total+=in;
}
cout<<total;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |