# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
954857 | 2024-03-28T18:07:27 Z | ramalzaher | Cyberland (APIO23_cyberland) | C++17 | 24 ms | 8028 KB |
#include "cyberland.h" #include<bits/stdc++.h> using namespace std ; double solve(int N, int M, int K, int H, std::vector<int> x, std::vector<int> y, std::vector<int> c, std::vector<int> arr) { long long dis[N+4] , vis[N+4] , p[N+4] ; vector<pair<int,int> > v[N+4] ; for(int i = 0; i < M ; i ++ ){ v[x[i]].push_back({y[i] , c[i] }) ; v[y[i]].push_back({x[i] , c[i] }) ; } for(int i = 0 ; i < N + 2 ; i ++ ) {dis[i] = 1e14 ;p[i] = -1; vis[i] = 0; } priority_queue<pair<int,int> , vector<pair<int,int> >, greater<pair<int,int> > > q; q.push({0 ,1 });dis[1] = 0 ; while(q.size()){ int top = q.top().second ; q.pop() ; int node = top ; if(vis[node])continue ;vis[node] =1 ; for(auto it : v[top]){ if(it.second + dis[top] <= dis[it.first]){ p[it.first] = top ; dis[it.first] = it.second+dis[top] ; q.push({dis[it.first] , it.first}); } } } int ans = dis[H] ; if(ans >= 1e14 ){ans = -1 ;} return ans; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 13 ms | 856 KB | Wrong Answer. |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 18 ms | 1364 KB | Double -1.07275e+09 violates the range [-1, 1e+18] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 21 ms | 1360 KB | Double -2.10154e+09 violates the range [-1, 1e+18] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 24 ms | 8028 KB | Double -7.94815e+08 violates the range [-1, 1e+18] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 18 ms | 1368 KB | Double -1.91161e+09 violates the range [-1, 1e+18] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 20 ms | 1368 KB | Wrong Answer. |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 20 ms | 1372 KB | Wrong Answer. |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 21 ms | 1368 KB | Wrong Answer. |
2 | Halted | 0 ms | 0 KB | - |