# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
57889 | gabrielsimoes | Chase (CEOI17_chase) | C++17 | 2101 ms | 256924 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;
const int MAXN = 1e5+10, MAXV = 101;
int n, vMax;
ll p[MAXN];
vector<int> g[MAXN];
int a[MAXN], b[MAXN];
ll dp[MAXN][MAXV][3];
ll f(int curEdge, int v, int dir) {
if (v == 0) return 0;
ll &ret = dp[curEdge][v][dir];
if (ret != -1) return ret;
ret = 0;
int cur, prev;
if (dir == 0) cur = curEdge, prev = -1;
else if (dir == 1) prev = a[curEdge], cur = b[curEdge];
else cur = a[curEdge], prev = b[curEdge];
ll sumAll = 0;
for (int edge : g[cur]) {
int nx = a[edge] == cur ? b[edge] : a[edge];
if (nx != prev) {
sumAll += p[nx];
}
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |