# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
983526 | sofija6 | Star triangles (IZhO11_triangle) | C++14 | 256 ms | 15700 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
#define MAXN 300010
using namespace std;
map<ll,ll> cntx,cnty;
ll x[MAXN],y[MAXN];
int main()
{
ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
ll n;
cin >> n;
for (ll i=1;i<=n;i++)
{
cin >> x[i] >> y[i];
cntx[x[i]]++;
cnty[y[i]]++;
}
ll ans=0;
for (ll i=1;i<=n;i++)
ans+=(cntx[x[i]]-1)*(cnty[y[i]]-1);
cout << ans;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |