# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
415582 | 2021-06-01T08:54:30 Z | 조영욱(#7635) | Escape Route (JOI21_escape_route) | C++17 | 528 ms | 154960 KB |
#include "escape_route.h" #include <bits/stdc++.h> using namespace std; int n,m; typedef pair<long long,long long> P; typedef pair<int,P> iP; vector<iP> adj[40]; long long dist[40]; bool vis[40]; void dijkstra(int st,int t) { priority_queue<P,vector<P>,greater<P>> pq; for(int i=0;i<n;i++) { dist[i]=1e16; vis[i]=true; } pq.push(P(t,st)); dist[st]=t; while (!pq.empty()) { int now; do { now=pq.top().second; pq.pop(); } while (!pq.empty()&&vis[now]); if (vis[now]) { break; } vis[now]=true; for(int i=0;i<adj[now].size();i++) { int nt=adj[now][i].first; long long d=dist[now]+adj[now][i].second.first; if (d<=adj[now][i].second.second) { dist[nt]=d; pq.push(P(dist[nt],nt)); } } } } vector<long long> calculate_necessary_time( int N, int M, long long S, int Q, vector<int> A, vector<int> B, std::vector<long long> L, std::vector<long long> C, std::vector<int> U, std::vector<int> V, std::vector<long long> T) { n=N; m=M; for(int i=0;i<m;i++) { adj[A[i]].push_back(iP(B[i],P(L[i],C[i]))); adj[B[i]].push_back(iP(A[i],P(L[i],C[i]))); } int q=T.size(); vector<long long> ret; for(int i=0;i<q;i++) { dijkstra(U[i],T[i]); ret.push_back(dist[V[i]]); } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 30 ms | 64948 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 528 ms | 154960 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 30 ms | 64948 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 30 ms | 64948 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 30 ms | 64948 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |