# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
76212 | nvmdava | Star triangles (IZhO11_triangle) | C++17 | 854 ms | 39120 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;
map<int, int> x, y;
int xx[300001], yy[300001];
int main(){
int n;
cin>>n;
for(int i = 1; i <= n; i++){
cin>>xx[i]>>yy[i];
x[xx[i]]++;
y[yy[i]]++;
}
long long s = 0;
for(int i = 1; i <= n; i++){
s += (long long)(x[xx[i]] - 1) * (y[yy[i]] - 1);
}
cout<<s;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |