제출 #77031

#제출 시각아이디문제언어결과실행 시간메모리
77031farukkastamonudaBosses (BOI16_bosses)C++14
0 / 100
2 ms1020 KiB
#include <bits/stdc++.h>
#define li 10005
#define lo long long
using namespace std ;
lo int n,x,y,vis[li],sub[li];
vector<lo int> v[li];
void dfs(lo int node,lo int ata){
    vis[node]=1;
    sub[node]=1;
    for(int i=0;i<(int)v[node].size();i++){
       lo int go=v[node][i];
        if(vis[go]==0 && go!=ata){
            dfs(go,node);
            sub[node]+=sub[go];
        }
    }
    sub[node]+=1;
}
int main(){
    scanf("%lld",&n);
    for(int i=1;i<=n;i++){
        scanf("%lld",&x);
        for(int j=1;j<=x;j++){
            scanf("%lld",&y);
            v[y].push_back(i);
        }
    }
    lo int cev=0;
    for(int i=1;i<=n;i++){
        dfs(i,i);
        cev=max(cev,sub[i]);
        memset(vis,0,sizeof(vis));
        memset(sub,0,sizeof(sub));
    }
    printf("%lld\n",cev);
    return 0;
}

컴파일 시 표준 에러 (stderr) 메시지

bosses.cpp: In function 'int main()':
bosses.cpp:20:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%lld",&n);
     ~~~~~^~~~~~~~~~~
bosses.cpp:22:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%lld",&x);
         ~~~~~^~~~~~~~~~~
bosses.cpp:24:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
             scanf("%lld",&y);
             ~~~~~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...