# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
867928 | serifefedartar | The Xana coup (BOI21_xanadu) | C++17 | 56 ms | 15892 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define fast ios::sync_with_stdio(0);cin.tie(0);
#define s second
#define f first
typedef long long ll;
const ll MOD = 1e9+7;
const ll P = 31;
const ll LOGN = 20;
const ll MAXN = 1e5 + 100;
#define int long long
vector<vector<int>> graph;
int active[MAXN], dp[MAXN][2][2], temp_dp[2];
void act(int node, int parent) {
temp_dp[0] = 0;
temp_dp[1] = 1e8;
for (auto u : graph[node]) {
if (u == parent)
continue;
int td0 = temp_dp[0], td1 = temp_dp[1];
temp_dp[0] = min(td1 + dp[u][1][1], td0 + dp[u][0][1]);
temp_dp[1] = min(td1 + dp[u][0][1], td0 + dp[u][1][1]);
}
dp[node][1][0] = temp_dp[0] + 1;
dp[node][1][1] = temp_dp[1] + 1;
temp_dp[0] = 0;
temp_dp[1] = 1e8;
# | 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... |