# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
531950 | christinelynn | 별들과 삼각형 (IZhO11_triangle) | C++17 | 312 ms | 18500 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |