# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1054181 | NeroZein | Cats or Dogs (JOI18_catdog) | C++17 | 0 ms | 0 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;
#ifdef Nero
#include "Deb.h"
#else
#define debug(...)
#endif
const int N = 1003;
int a[N];
bool flag;
int dp[N][2];
vector<int> g[N];
void initialize(int n, vector<int> A, vector<int> B) {
for (int i = 0; i < n - 1; ++i) {
g[A[i]].push_back(B[i]);
g[B[i]].push_back(A[i]);
}
}
void dfs(int v, int p) {
dp[v][0] = dp[v][1] = 0;
for (int u : g[v]) {
if (u != p) {
dfs(u, v);
}
}