# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
920294 | hasuhasuiro | Star triangles (IZhO11_triangle) | C++17 | 348 ms | 12368 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 X(N, 0), Y(N, 0);
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]]++;
for(int i = 0; i < N; i++) mpy[Y[i]]++;
long long ans(0);
for(int i = 0; i < N; i++) ans += ((long long)(mpx[X[i]]-1) * (long long)(mpy[Y[i]]-1));
cout << ans << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |