# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
531684 | makanhulia | Star triangles (IZhO11_triangle) | C++17 | 374 ms | 15544 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 nyahalo ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define otsumiko exit(0);
#define mikodanye priority_queue<pair<long long, long long>, vector<pair<long long, long long> >, greater<pair<long long, long long> > >
#define mikochi priority_queue<long long, vector<long long>, greater<long long> >
long long x[300069], y[300069];
int main() {
nyahalo
long long n, ans = 0;
cin >> n;
map<long long, long long> mpx, mpy;
for (long long i=1; i<=n; i++) {
cin >> x[i] >> y[i];
mpx[x[i]]++;
mpy[y[i]]++;
}
for (long long i=1; i<=n; i++) {
ans += (mpx[x[i]]-1)*(mpy[y[i]]-1);
}
cout << ans << "\n";
otsumiko
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |