답안 #915645

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
915645 2024-01-24T12:48:16 Z 0xZero Burza (COCI16_burza) C++17
컴파일 오류
0 ms 0 KB
#include "template_light.h"
#define bs bitset<mx>
const int mx=400;
int n, k;
vi adj[mx];
int dep[mx], mxd[mx]={0};
void dfs(int u, int e){
    mxd[u]=dep[u];
    each(i, adj[u])if(i!=e){
        dep[i]=dep[u]+1;
        dfs(i, u);
        mxd[u]=max(mxd[u], mxd[i]);
    }
}

bool f(int x, int y, const bs &b){
    if(x==y)return 0;
    bs c(0);
    bool ans=0;
    F0R(i, n)if(b[i])each(j, adj[i])if(dep[j]>dep[i] && mxd[j]>=y)c[j]=1;
    if(c.count()<=1)return 1;
    F0R(i, n)if(c[i]){
        c[i]=0;
        ans|=f(x+1, y, c);
        c[i]=1;
    }
    return ans;
}

int main(){
    IOS;
    re(n, k);
    rep(n-1){
        int a, b;
        re(a, b);
        a--;b--;
        adj[a].pb(b);
        adj[b].pb(a);
    }
    dep[0]=0;
    dfs(0, -1);
    bs b(1);
    if(f(0, k, b))pr("DA");
    else pr("NE");
    return 0;
}

Compilation message

burza.cpp:1:10: fatal error: template_light.h: No such file or directory
    1 | #include "template_light.h"
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.