# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
479274 | mewnian | Star triangles (IZhO11_triangle) | C++14 | 1188 ms | 34392 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define sze(x) (ll)x.size()
#define idx(x, a) get<x>(a)
#define LID(x) (x << 1LL)
#define RID(x) (x << 1LL) + 1LL
#define ID(x) (x + MAXN)
#define CONV(x) (x - MAXN)
#define countbit(x) __builtin_popcountll(x)
#define pb push_back
#define x first
#define y second
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> pi;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll rand(ll l, ll r)
{
return uniform_int_distribution<ll>(l, r)(rng);
}
const ll MAXN = 300'003;
ll n;
pi a[MAXN];
map< ll, ll > cx, cy;
map< pi, ll > pts;
int main()
{
ios_base::sync_with_stdio(0); cin.tie(0);
#ifdef OFFLINE
freopen("input.inp", "r", stdin);
#endif
cin >> n;
for (ll i = 1; i <= n; ++i)
{
cin >> a[i].x >> a[i].y;
++cx[a[i].x], ++cy[a[i].y];
++pts[a[i]];
}
ll res = 0;
for (ll i = 1; i <= n; ++i)
{
res += (cx[a[i].x] - pts[a[i]]) * (cy[a[i].y] - pts[a[i]]);
}
cout << res;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |