이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "crocodile.h"
#include <vector>
#include <utility>
#include <algorithm>
#include <queue>
#include <map>
using namespace std;
bool is[100005];
long long small[5][100005];
vector < pair < long long , long long > > Next[100005];
priority_queue < pair < long long , pair < long long , long long > > , vector < pair < long long , pair < long long , long long > > > , greater < pair < long long , pair < long long , long long > > > > dij;
int travel_plan(int N, int M, int R[][2], int L[], int K, int P[])
{
    int i;
    long long a,b,c;
    for(i=0;i<M;i++)
    {
        Next[R[i][0]].push_back(make_pair((long long) R[i][1],(long long) L[i]));
        Next[R[i][1]].push_back(make_pair((long long) R[i][0],(long long) L[i]));
    }
    for(i=0;i<N;i++)
    {
        small[0][i]=-1;
        small[1][i]=-1;
    }
    for(i=0;i<K;i++)
    {
        is[P[i]]=1;
        dij.push(make_pair(0,make_pair(P[i],-1)));
        small[0][P[i]]=0;
        small[1][P[i]]=0;
    }
    while(!dij.empty())
    {
        a=dij.top().first;
        b=dij.top().second.first;
        c=dij.top().second.second;
        dij.pop();
        if(is[b]&&small[0][b]==0)
        {
            small[0][b]=-2;
            small[1][b]=-2;
            for(auto i:Next[b])
            {
                dij.push(make_pair(i.second+a,make_pair(i.first,b)));
            }
        }
        else if(small[0][b]==-1) small[0][b]=a;
        else if(small[1][b]==-1)
        {
            small[1][b]=a;
            for(auto i:Next[b])
            {
                dij.push(make_pair(i.second+a,make_pair(i.first,b)));
            }
        }
        else continue;
    }
    return small[1][0];
}
컴파일 시 표준 에러 (stderr) 메시지
crocodile.cpp: In function 'int travel_plan(int, int, int (*)[2], int*, int, int*)':
crocodile.cpp:15:19: warning: variable 'c' set but not used [-Wunused-but-set-variable]
   15 |     long long a,b,c;
      |                   ^| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... |