# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
897793 | Trumling | Crocodile's Underground City (IOI11_crocodile) | C++14 | 405 ms | 89880 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "crocodile.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define F first
#define S second
#define enter cout<<'\n';
#define INF 9999999999999999
#define MOD 1000000007
#define round fixed<<setprecision(2)<<
int travel_plan(int N, int M, int R[][2], int L[], int K, int P[])
{
vector<vector<pair<ll,ll>>>g(N+1);
for(int i=0;i<M;i++)
{
g[R[i][0]].pb({R[i][1],L[i]});
g[R[i][1]].pb({R[i][0],L[i]});
}
priority_queue<pair<ll,ll>>pq;
vector<pair<ll,ll>>dist(N+1,{INF,INF});
for(int i=0;i<K;i++)
{
dist[P[i]]={0,0};
pq.push({0,P[i]});
}
while(!pq.empty())
{
ll curr=pq.top().S;
ll w=-pq.top().F;
pq.pop();
if(dist[curr].S<w)
continue;
for(auto x:g[curr])
{
if(dist[x.F].F> w + x.S)
{
if(dist[x.F].F!=dist[x.F].S)
pq.push({-dist[x.F].F,x.F});
swap(dist[x.F].F,dist[x.F].S);
dist[x.F].F=w + x.S;
// pq.push({-dist[x.F].F,x.F});
continue;
}
if(dist[x.F].S> w + x.S)
{
dist[x.F].S=w + x.S;
pq.push({-dist[x.F].S,x.F});
}
}
}
return (int) dist[0].S;
}
컴파일 시 표준 에러 (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... |