# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
975533 | vjudge1 | Star triangles (IZhO11_triangle) | C++17 | 249 ms | 15684 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 int long long
#define Foxfur ios_base::sync_with_stdio(0);cin.tie(NULL);
int32_t main()
{
Foxfur
int n; cin >> n;
int maxn = 3e5+5;
map <int,int> jmlx;
map <int, int> jmly;
int arrx[maxn];
int arry[maxn];
for(int i=0; i<n; i++)
{
cin >> arrx[i] >> arry[i];
jmlx[arrx[i]]++;
jmly[arry[i]]++;
}
int ans=0;
for(int i=0; i<n; i++)
{
ans += 1ll * (jmlx[arrx[i]]-1) * (jmly[arry[i]]-1);
}
cout << ans << endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |