# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
976876 | vjudge1 | Star triangles (IZhO11_triangle) | C++17 | 1 ms | 600 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
signed main(){
int n;
cin >> n;
map<int, int> cx, cy;
int x[n+1], y[n+1];
for(int i = 0; i < n; i++){
cin >> x[i] >> y[i];
cx[x[i]]++;
cy[y[i]]++;
}
int ans = 0;
for(int i = 0; i < n; i++){
ans += (cx[x[i]] - 1) * (cx[y[i]] - 1);
}
cout << ans << endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |