# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
976054 | vjudge1 | Star triangles (IZhO11_triangle) | C++17 | 374 ms | 5820 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;
const int kaps = 3e5 + 5;
int main(){
long long n;
cin >> n;
int x[kaps], y[kaps];
int ans = 0;
map <int, int> jx;
map <int, int> jy;
for(int i = 0; i < n; i++){
cin >> x[i] >> y[i];
jx[x[i]]++;
jy[y[i]]++;
}for(int i = 0; i < n; i++){
ans += (jx[x[i]] - 1) * (jy[y[i]] - 1);
}cout << ans << endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |