# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
983481 | OAleksa | The Xana coup (BOI21_xanadu) | C++14 | 63 ms | 23548 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define f first
#define s second
using namespace std;
#define int long long
const int N = 1e5 + 69;
const int inf = 1e9 + 69;
int n, dp[N][2][2], a[N];
vector<int> g[N];
void dfs(int v, int p) {
vector<int> ch;
for (auto u : g[v]) {
if (u == p)
continue;
dfs(u, v);
ch.push_back(u);
}
if (ch.empty()) {
dp[v][a[v]][0] = 0;
dp[v][a[v] ^ 1][1] = 1;
dp[v][a[v]][1] = dp[v][a[v] ^ 1][0] = inf;
}
else {
int uk1 = 0, uk2 = 0;
int mn1 = inf, mn2 = inf, c = 0;
for (auto u : ch) {
uk1 += min(dp[u][0][0], dp[u][0][1]);
if (dp[u][0][0] <= dp[u][0][1])
mn1 = min(mn1, dp[u][0][1] - dp[u][0][0]);
if (dp[u][0][1] <= dp[u][0][0]) {
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |