# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
168100 | GioChkhaidze | 별들과 삼각형 (IZhO11_triangle) | C++14 | 529 ms | 15608 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
using namespace std;
const int N=3e5+5;
ll n,x[N],y[N],ans;
map < ll , ll > f1,f2;
main () {
scanf("%d",&n);
for (int i=1; i<=n; i++) {
scanf("%d%d",&x[i],&y[i]);
f1[x[i]]++,f2[y[i]]++;
}
for (int i=1; i<=n; i++)
ans+=(f1[x[i]]-1)*(f2[y[i]]-1);
printf("%lld\n",ans);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |