# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
344326 | nicolaalexandra | Star triangles (IZhO11_triangle) | C++14 | 584 ms | 5740 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 DIM 300010
using namespace std;
map <int,int> x,y;
pair <int,int> v[DIM];
int n,i;
int main (){
//ifstream cin ("date.in");
//ofstream cout ("date.out");
cin>>n;
for (i=1;i<=n;i++){
cin>>v[i].first>>v[i].second;
x[v[i].first]++;
y[v[i].second]++;
}
long long sol = 0;
for (i=1;i<=n;i++)
sol += 1LL * (x[v[i].first] - 1) * (y[v[i].second] - 1);
cout<<sol;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |