# Can someone solve FREETICKET from INOI 2014?

Hi everyone.
I've been practicing on the INOI server lately, however I've not yet solved even a single question. I studied Graph Theory for the first time last week and decided to do the FREETICKET problem using Djikstra's Algorithm ([here][1]).
I've tried to solve the problem innumerable times, but am still not able to do so. If someone could please tell me the pseudocode, it'll be of great help. I'm asking for the pseudo code as I program in Java and am sometimes not able to understand c++ syntax.
Also, if you could review my pseudo code once, I'll be very grateful.
<code>
int[] max = new int[vertices]
for each vertex u = 1 -> v:
int[] dist = new int[vertices]
dist[u] = 0
for each int i = 1 -> v:
if i != u:
dist[i] = INFINITY
for each int i = 0 -> v:
if edge exists from u->i:
int tmp = dist[u] + weight[u][i]
if tmp < dist[i]:
dist[i] = tmp
max[u] = maximum(dist)
int f = maximum(max)
return f //here max is an array and maximum is the
//function for finding maximum value
</code>
I realize this is a tedious work but please help me, it's really important.
Thank you all for your help, guys.
~~
~~Note: when I'm trying the sample case, it returns maximum int value, which means the relaxation is not being done properly.
[1]: http://www.iarcs.org.in/inoi/2014/inoi2014/inoi2014-qpaper.pdf