제출 #969772

#제출 시각아이디문제언어결과실행 시간메모리
969772zh_h사이버랜드 (APIO23_cyberland)C++17
0 / 100
22 ms7556 KiB
#include <bits/stdc++.h> #define pb push_back using namespace std; const int n = 1e5+5; vector<vector<pair<int, int>>> adj(n); vector<bool> visited(n, false); double dfs(int x, int h, int s){ if(x == h){return s;} for(auto i : adj[x]){ if(!visited[i.first]){ visited[i.first] = true; return dfs(i.first, h, s+i.second); } } } double solve(int N, int M, int K, int H, vector<int> x, vector<int> y, vector<int> c, vector<int> arr){ visited.clear(); visited.resize(n, false); adj.clear(); visited[0] = true; for(int i =0; i < M; i ++){ adj[x[i]].pb({y[i], c[i]}); adj[y[i]].pb({x[i], c[i]}); } return dfs(0, H, 0); }

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

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