| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 426206 | chirathnirodha | Crocodile's Underground City (IOI11_crocodile) | C++17 | 665 ms | 73012 KiB | 
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
//Coded by Chirath Nirodha
#include "crocodile.h"
#include<bits/stdc++.h>
using namespace std;
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define P push
typedef long long ll;
 
int travel_plan(int N, int M, int R[][2], int L[], int K, int P[]){
  vector<pair<ll,ll> > adj[N];
  for(int i=0;i<M;i++){
    adj[R[i][0]].PB(MP(R[i][1],L[i]));
    adj[R[i][1]].PB(MP(R[i][0],L[i]));
  }
  ll shortest[N][2];
  for(int i=0;i<N;i++){
    shortest[i][0]=10000000000000000;
    shortest[i][1]=10000000000000000;
  }
  priority_queue<pair<ll,ll> > q;
  for(int i=0;i<K;i++){
    shortest[P[i]][0]=0;
    shortest[P[i]][1]=0;
    q.P(MP(0,P[i]));
  }
  while(!q.empty()){
    int c=q.top().S;
    ll val=-q.top().F;
    q.pop();
    if(val>shortest[c][1])continue;
    for(int i=0;i<adj[c].size();i++){
      int a=adj[c][i].F;
      ll len=adj[c][i].S;
	  ll pre=shortest[a][1];
      if(shortest[a][0]>val+len){
        shortest[a][1]=shortest[a][0];
        shortest[a][0]=val+len;
      }
      else if(shortest[a][1]>val+len)shortest[a][1]=val+len;
	  
	  if(shortest[a][1]<pre)q.P(MP(-shortest[a][1],a));
    }
  }
  int ans=shortest[0][1];
  return ans;
}
Compilation message (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... | ||||
