# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
787479 | anton | Star triangles (IZhO11_triangle) | C++17 | 400 ms | 15552 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
const int MAX_N = 3*1e6;
int n, pos[MAX_N][2];
map<int, int> x;
map<int, int> y;
signed main(){
cin>>n;
for(int i = 0; i<n; i++){
cin>>pos[i][0]>>pos[i][1];
x[pos[i][0]]++;
y[pos[i][1]]++;
}
int res= 0;
for(int i = 0; i<n; i++){
res+=(x[pos[i][0]]-1LL)*(y[pos[i][1]]-1);
}
cout<<res<<endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |