# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
568001 | hgmhc | Bitaro’s Party (JOI18_bitaro) | C++17 | 885 ms | 110756 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 ii = pair<int,int>; using ll = long long;
#define rep(i,a,b) for (auto i = (a); i <= (b); ++i)
#define all(x) (x).begin(), (x).end()
#define size(x) int((x).size())
#define Mup(x,y) x = max(x,y)
#define mup(x,y) x = min(x,y)
const int N = 1e5+3, B = 100;
int n, m, q;
vector<int> rdj[N];
int dp[N], c[N];
bool come[N];
vector<ii> distances[N];
#define D first
#define F second
void precalc() {
bool used[N] {0,};
rep(i,1,n) {
for (int j : rdj[i]) {
auto &x = distances[i], &y = distances[j];
vector<ii> tmp; // tmp <- x + y
int a = 0, b = 0;
while (a < size(x) or b < size(y)) {
if (a >= size(x) or (b < size(y) and y[b].D+1 >= x[a].D)) {
if (!used[y[b].F]) tmp.emplace_back(y[b].D+1,y[b].F);
used[y[b].F] = true;
b++;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |