# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1087905 | LilPluton | Star triangles (IZhO11_triangle) | C++14 | 389 ms | 15660 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 ll
#define ll long long
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
const int sz = 1e5 + 5;
signed main(){
int n;
cin >> n;
vector<pair<int,int>>a(n);
map<int,int> cx, cy;
for(int i = 0; i < n; ++i){
cin >> a[i].first >> a[i].second;
cx[a[i].first]++;
cy[a[i].second]++;
}
int res = 0;
for(int i = 0; i < n; ++i){
int x, y;
tie(x, y) = a[i];
res += ((cx[x] - 1) * (cy[y] - 1));
}
cout << res << endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |