# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
975093 | Amaarsaa | Star triangles (IZhO11_triangle) | C++14 | 247 ms | 15028 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;
using ll = long long ;
map < int,int > X, Y;
int main() {
// freopen("moocast.in", "r", stdin);
// freopen("moocast.out", "w", stdout);
ios::sync_with_stdio(false);
cin.tie(NULL);
ll t, n, m, ans, s, sum, r, p, i, j;
cin >> n;
ll x[n + 2], y[n + 2];
for (i = 1; i <= n; i ++) {
cin >> x[i] >> y[i];
X[x[i]] ++;
Y[y[i]] ++;
}
ans = 0;
for (i = 1; i <= n; i ++) {
s = (X[x[i]] - 1) * (Y[y[i]] - 1);
ans += s;
}
cout << ans << endl;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |