제출 #347604

#제출 시각아이디문제언어결과실행 시간메모리
347604juggernaut열대 식물원 (Tropical Garden) (IOI11_garden)C++14
49 / 100
10 ms1388 KiB
#include"garden.h" #include"gardenlib.h" #include<bits/stdc++.h> using namespace std; #ifdef EVAL #else #include"grader.cpp" #endif vector<pair<int,int>>g[1005]; int dfs(int v,int p,int depth){ if(!depth)return v; int mn=2e9; for(auto to:g[v])if(to.first!=p)mn=min(mn,to.second); if(mn==(2e9))return dfs(p,v,depth-1); for(auto to:g[v])if(to.second==mn)return dfs(to.first,v,depth-1); } void count_routes(int N,int M,int P,int R[][2],int Q,int G[]){ for(int i=0;i<M;i++){ g[R[i][0]].push_back({R[i][1],i}); g[R[i][1]].push_back({R[i][0],i}); } int cnt=0; for(int i=0;i<N;i++) if(dfs(i,-1,G[0])==P)cnt++; answer(cnt); }

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

garden.cpp: In function 'int dfs(int, int, int)':
garden.cpp:16:1: warning: control reaches end of non-void function [-Wreturn-type]
   16 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...