# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
62730 | kingpig9 | Bitaro’s Party (JOI18_bitaro) | C++11 | 1988 ms | 416788 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;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int MAXN = 1e5 + 10;
const int SQRT = 320;
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define fi first
#define se second
#define all(v) (v).begin(), (v).end()
#define fillchar(a, s) memset((a), (s), sizeof(a))
int N, M, Q;
vector<int> adj[MAXN], radj[MAXN];
vector<pii> far[MAXN]; //farthest SQRT vertices: pair(dist, vertex)
pii tmp[2 * SQRT];
bool vis[MAXN];
void merge (vector<pii> &v, const vector<pii> &w) {
int sz = merge(all(v), all(w), tmp, greater<pii> ()) - tmp;
v.clear();
for (int i = 0; i < sz && v.size() < SQRT; i++) {
if (!vis[tmp[i].se]) {
v.push_back(tmp[i]);
vis[tmp[i].se] = true;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |