# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
144377 | Lawliet | Star triangles (IZhO11_triangle) | C++14 | 547 ms | 13408 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 MAX 300010
using namespace std;
typedef long long int lli;
int n;
int x[MAX];
int y[MAX];
lli ans;
map<int,lli> marcX;
map<int,lli> marcY;
int main()
{
scanf("%d",&n);
for(int g = 1 ; g <= n ; g++)
{
scanf("%d %d",&x[g],&y[g]);
marcX[ x[g] ]++;
marcY[ y[g] ]++;
}
for(int g = 1 ; g <= n ; g++)
ans += (marcX[ x[g] ] - 1)*(marcY[ y[g] ] - 1);
printf("%lld\n",ans);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |