# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
135128 | fredbr | Beads and wires (APIO14_beads) | C++17 | 2 ms | 636 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>
#pragma GCC optimize("O3")
using namespace std;
int const maxn = 10001;
struct Edge {
int u, w;
};
vector<Edge> v[maxn];
int n;
int dp[maxn][2];
inline int invalid(int x) {
return v[x].size() == 1;
}
int solve(int x, int p = -1, int t = 0) {
if (dp[x][t] >= 0) return dp[x][t];
int d = 0;
if (t == 0) {
for (Edge const& e : v[x]) {
if (e.u == p) continue;
if (!invalid(e.u)) {
# | 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... |