# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
834209 | ttamx | 악어의 지하 도시 (IOI11_crocodile) | C++14 | 353 ms | 61232 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "crocodile.h"
#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> p2;
const int N=1e5+5;
const int inf=2e9;
int n;
p2 dp[N];
bool vis[N];
vector<p2> adj[N];
priority_queue<p2,vector<p2>,greater<p2>> pq;
int travel_plan(int N, int M, int R[][2], int L[], int K, int P[]){
n=N;
for(int i=0;i<n;i++)dp[i]={inf,inf};
for(int i=0;i<M;i++){
int u=R[i][0],v=R[i][1],w=L[i];
adj[u].emplace_back(v,w);
adj[v].emplace_back(u,w);
}
for(int i=0;i<K;i++){
dp[P[i]]={0,0};
pq.emplace(0,P[i]);
}
while(!pq.empty()){
auto [d,u]=pq.top();
pq.pop();
if(vis[u])continue;
vis[u]=true;
for(auto [v,w]:adj[u]){
if(d+w<dp[v].second){
dp[v].second=d+w;
if(dp[v].second<dp[v].first)swap(dp[v].first,dp[v].second);
if(dp[v].second<inf)pq.emplace(dp[v].second,v);
}
}
}
return dp[0].second;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |