# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1156744 | nguyn | Factories (JOI14_factories) | C++20 | 1549 ms | 294572 KiB |
#include "factories.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define F first
#define S second
#define pb push_back
#define pii pair<int,int>
#define pil pair<int, ll>
const int MN = 1e6 + 5;
const ll inf = 1e18;
int n, q, tin[MN], tout[MN], h[MN], timedfs, type[MN];
ll f[MN][2], res, s[MN];
pii rmq[21][MN];
vector<pil> g[MN];
vector<pil> g2[MN];
void pre_dfs(int u, int p) {
tin[u] = ++timedfs;
rmq[0][timedfs] = {h[u], u};
for (auto it : g[u]) {
int v = it.F;
int w = it.S;
if (v == p) continue;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |