# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
333888 | BY_KUTBILIM | Star triangles (IZhO11_triangle) | C++14 | 375 ms | 6252 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.
/** @BY_KUTBILIM **/
#include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define pb push_back
#define ll long long
int main(){
ios_base::sync_with_stdio(false);
cin.tie();
int n;
cin >> n;
int x[n], y[n];
map<int,int> ox, oy;
for(int i = 0; i < n; i++){
cin >> x[i] >> y[i];
ox[x[i]]++;
oy[y[i]]++;
}
ll ans = 0;
for(int i = 0; i < n; i++){
ans += 1LL * (ox[x[i]] - 1) * (oy[y[i]] - 1);
}
cout << ans << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |