제출 #967049

#제출 시각아이디문제언어결과실행 시간메모리
967049akacool445k사이버랜드 (APIO23_cyberland)C++17
0 / 100
3038 ms6492 KiB
#include <bits/stdc++.h> #include "cyberland.h" using namespace std; // #define int long long #define ff first #define ss second const int shrek = 1e5; vector< vector<pair<int, int>>> adj(shrek); double solve(int n, int m, int k, int h, vector<int> x, vector<int> y, vector<int> c, vector<int> arr) { vector<int> dist (n + 1); for(int i = 0; i < n; i++) dist[i] = -1; for(int i = 0; i < m; i++) { adj[x[i]].push_back({y[i], c[i]}); adj[y[i]].push_back({x[i], c[i]}); } priority_queue <pair<int, int>> q; q.push({0, 0}); while(!q.empty()) { pair<int, int> p = q.top(); q.pop(); if(dist[p.ss] != -1) continue; dist[p.ss] = -p.ff; for(auto x : adj[p.ss]) { q.push({p.ff - x.ss, x.ff}); } } return dist[h]; }
#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...