# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
531950 | christinelynn | Star triangles (IZhO11_triangle) | C++17 | 312 ms | 18500 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 REP(v, i, j) for (ll v = i; v < j; v++)
#define FORI(v) for (auto i : v)
#define FORJ(v) for (auto j : v)
#define OUT(v, a) FORI(v) cout << i << a;
#define OUTS(v, a, b) cout << v.size() << a; OUT(v, b)
#define in(a, n) REP(i, 0, n) cin >> a[i];
#define SORT(v) sort(begin(v), end(v))
#define REV(v) reverse(begin(v), end(v))
#define pb push_back
#define fi first
#define se second
#define detachIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pii;
typedef pair<pii, ll> piii;
typedef pair<pii, pii> piiii;
map<ll, ll> x, y;
vector<pii> v;
int main()
{
detachIO;
ll N;
cin >> N;
while (N--)
{
ll a, b;
cin >> a >> b;
x[a]++, y[b]++;
v.pb({a, b});
}
ll ans = 0;
FORI(v)
{
ans += (x[i.fi] - 1) * (y[i.se] - 1);
}
cout << ans << '\n';
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |