제출 #880274

#제출 시각아이디문제언어결과실행 시간메모리
880274Mardonbekhazratov사이버랜드 (APIO23_cyberland)C++17
0 / 100
21 ms6844 KiB
#include "cyberland.h" #include<bits/stdc++.h> #include <vector> using namespace std; double solve(int N, int M, int K, int H, vector<int> x, vector<int> y, vector<int> c, vector<int> arr) { vector<vector<pair<int,int>>>v(N); for(int i=0;i<N;i++){ v[x[i]].push_back({y[i],c[i]}); v[y[i]].push_back({x[i],c[i]}); } vector<bool>vis(N,0); queue<pair<int,double>>q; q.push({0,0.0}); while(!q.empty()){ pair<int,double>p=q.front(); q.pop(); if(vis[p.first]) continue; vis[p.first]=true; if(p.first==H){ return p.second; } for(auto [z,y]:v[p.first]){ q.push({z,p.second+y}); } } }

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

cyberland.cpp: In function 'double solve(int, int, int, int, std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>)':
cyberland.cpp:7:37: warning: control reaches end of non-void function [-Wreturn-type]
    7 |     vector<vector<pair<int,int>>>v(N);
      |                                     ^
#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...