# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
17676 | Adilkhan | Star triangles (IZhO11_triangle) | C++98 | 532 ms | 13624 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 pb push_back
#define endl "\n"
#define mp make_pair
#define fi first
#define se second
#define all(x) x.begin(), x.end()
#define fname ""
#define sz(x) (int)(x.size())
typedef long long ll;
using namespace std;
const ll N = (ll)(5e5) + 322;
const ll INF = (ll)(1e9);
const ll mod = (ll)(1e9) + 7;
const double eps = 1e-9;
ll n, x[N], y[N], ans;
map <ll, ll> X, Y;
int main () {
ios_base :: sync_with_stdio (false); cin.tie(0);
// freopen(fname".in", "r", stdin);
//freopen(fname".out", "w", stdout);
cin >> n;
for (int i = 1; i <= n; ++i) {
cin >> x[i] >> y[i];
X[x[i]]++;
Y[y[i]]++;
}
for (int i = 1; i <= n; ++i) {
ans += (X[x[i]] - 1) * (Y[y[i]] - 1);
}
cout << ans;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |