# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
88424 | xiaowuc1 | Star triangles (IZhO11_triangle) | C++14 | 491 ms | 34424 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;
typedef long long ll;
int x[300000];
int y[300000];
void solve() {
map<int, int> xs;
map<int, int> ys;
int n;
cin >> n;
for(int i = 0; i < n; i++) {
cin >> x[i] >> y[i];
xs[x[i]]++;
ys[y[i]]++;
}
ll ret = 0;
for(int i = 0; i < n; i++) {
ret += (xs[x[i]] - 1LL) * (ys[y[i]] - 1LL);
}
cout << ret << endl;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
solve();
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |