# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
211371 | shart23 | Dango Maker (JOI18_dango_maker) | C++14 | 2093 ms | 1408 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>
#define endl "\n"
using namespace std;
const int MAXN = 100;
vector<int> vin[MAXN][MAXN];
vector<int> g[MAXN * MAXN];
int used[MAXN * MAXN];
int nn[MAXN * MAXN];
int sm[MAXN * MAXN];
set<int> g2[MAXN * MAXN];
pair<int, int> dp[MAXN * MAXN];
void dfs3(int v, int p) {
used[v] = 3;
if (sm[v] > 1) {
dp[v].first = sm[v] / 2;
dp[v].second = sm[v] / 2;
} else {
dp[v].first = 1;
}
for (int u : g2[v]) {
if (u != p && used[u] != 3) {
dfs3(u, v);
dp[v].first += dp[u].second;
dp[v].second += max(dp[u].first, dp[u].second);
}
}
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... |