| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 402706 | Antekb | 악어의 지하 도시 (IOI11_crocodile) | C++14 | 817 ms | 61560 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "crocodile.h"
#include<bits/stdc++.h>
using namespace std;
#define st first
#define nd second
#define mp(x, y) make_pair(x ,y)
typedef long long ll;
const ll INF=1e18;
int travel_plan(int N, int M, int R[][2], int L[], int K, int P[])
{
ll dist[N], dist2[N];
vector<pair<int, int> > E[N];
for(int i=0; i<M; i++){
E[R[i][0]].push_back(mp(R[i][1], L[i]));
E[R[i][1]].push_back(mp(R[i][0], L[i]));
}
for(int i=0; i<N;i++)dist[i]=dist2[i]=INF;
for(int i=0; i<K; i++)dist[P[i]]=dist2[P[i]]=0;
set<pair<ll, int> > S;
for(int i=0;i<N; i++){
S.insert(mp(dist[i], i));
}
while(S.size()){
int v=(*S.begin()).nd;
S.erase(S.begin());
if(v==0){
return dist[v];
}
for(auto i:E[v]){
if(dist[v]+i.nd<dist[i.st]){
S.erase(S.find(mp(dist[i.st], i.st)));
if(dist[v]+i.nd>dist2[i.st])dist[i.st]=dist[v]+i.nd;
else{
dist[i.st]=dist2[i.st];
dist2[i.st]=dist[v]+i.nd;
}
S.insert(mp(dist[i.st], i.st));
}
}
}
}
컴파일 시 표준 에러 (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... | ||||
