# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
906053 | Mathias | The Xana coup (BOI21_xanadu) | C++14 | 66 ms | 20564 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int MAXN = 1e5+7;
const long long INF = 1e9+7;
long long dp[MAXN][3][3];
bool t[MAXN], visited[MAXN];
vector<long long> g[MAXN];
long long n,a,b,c,d;
void DFS(int x,int f){
visited[x]=1;
if(t[x]){
dp[x][1][0]=1;
dp[x][0][1]=0;
}
else{
dp[x][1][1]=1;
dp[x][0][0]=0;
}
for(int i=0;i<g[x].size();i++){
if(visited[g[x][i]]==1) continue;
int s=g[x][i];
DFS(s,x);
}
for(int i=0;i<g[x].size();i++){
int s=g[x][i];
if(s==f) continue;
a=dp[x][0][0], b=dp[x][0][1], c=dp[x][1][0], d=dp[x][1][1];
dp[x][0][0]=min(a+dp[s][0][0], b+dp[s][1][0]);
dp[x][0][1]=min(b+dp[s][0][0], a+dp[s][1][0]);
컴파일 시 표준 에러 (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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |