# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
680208 | Angus_Yeung | Star triangles (IZhO11_triangle) | C++17 | 330 ms | 15552 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>
#define x first
#define y second
#define pii pair<ll, ll>
typedef long long ll;
const ll MOD = 1000000007LL;
const ll INF = 1e18;
using namespace std;
ll n, x[300010], y[300010], ans;
map<ll, ll> mx, my;
int main() {
cin.tie(0); cout.tie(0);
ios::sync_with_stdio(0);
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> x[i] >> y[i];
mx[x[i]]++;
my[y[i]]++;
}
ans = 0;
for (int i = 1; i <= n; i++) {
ans += (mx[x[i]]-1)*(my[y[i]]-1);
}
cout << ans << "\n";
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |