# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
572243 | SSRS | Star triangles (IZhO11_triangle) | C++14 | 486 ms | 12188 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;
int main(){
int N;
cin >> N;
vector<int> X(N), Y(N);
for (int i = 0; i < N; i++){
cin >> X[i] >> Y[i];
}
map<int, int> mpX, mpY;
for (int i = 0; i < N; i++){
mpX[X[i]]++;
mpY[Y[i]]++;
}
long long ans = 0;
for (int i = 0; i < N; i++){
ans += (long long) (mpX[X[i]] - 1) * (mpY[Y[i]] - 1);
}
cout << ans << endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |