# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
363656 | 2021-02-06T18:13:41 Z | David_M | 악어의 지하 도시 (IOI11_crocodile) | C++14 | 2 ms | 2688 KB |
#include "crocodile.h" #include<bits/stdc++.h> #define F first #define S second #define ll long long #define pll pair<ll, ll> using namespace std; const ll INF=1e18, N=100005; ll d,x,o,i; pll D[N]; vector<pll>v[N]; priority_queue<pll>q; int travel_plan(int n,int m,int R[][2],int L[],int k,int p[]){ for(i=0;i<m;i++) v[R[i][0]].push_back({R[i][1],L[i]}), v[R[i][1]].push_back({R[i][0],L[i]}); for(i=0;i<n;i++)D[i]={INF,INF}; for(i=0;i<k;i++)D[p[i]]={0,0},q.push({0,p[i]}); while(!q.empty()){ auto[d,x]=q.top(); q.pop(); for (auto[y,l]:v[x]){ o=D[y].F; if(D[y].F>l-d)D[y].F=l-d; if(D[y].F<D[y].S)swap(D[y].F,D[y].S); if(D[y].F!=o)q.push({-D[y].F,y}); } } return D[0].F; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 2668 KB | Output is correct |
2 | Correct | 2 ms | 2668 KB | Output is correct |
3 | Incorrect | 2 ms | 2688 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 2668 KB | Output is correct |
2 | Correct | 2 ms | 2668 KB | Output is correct |
3 | Incorrect | 2 ms | 2688 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 2668 KB | Output is correct |
2 | Correct | 2 ms | 2668 KB | Output is correct |
3 | Incorrect | 2 ms | 2688 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |