# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
884789 | Isam | Star triangles (IZhO11_triangle) | C++17 | 238 ms | 12260 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>
#ifdef DEBUG
#include "debug.h"
#else
#define debug(...) void(37)
#endif
using namespace std;
signed main(){
ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
int N;
cin >> N;
map<int, int> X, Y;
vector<pair<int, int>> A(N);
for(register int i = 0; i < N; ++i){
cin >> A[i].first >> A[i].second;
X[A[i].first]++, Y[A[i].second]++;
}
long long ans(0);
for(register int i = 0; i < N; ++i){
ans += 1ll * (X[A[i].first] - 1) * (Y[A[i].second] - 1);
}
cout << ans << '\n';
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |