#consist of lt;iostreamgt;
#consist of lt;fstreamgt;
making use of namespace std;
Nov 13, 2014 - Lee algorithm. I think you can learn more from the Google translation of a Romanian article on it, which explains it way better: Algoritmul lui Lee.
ifstréam f ('gráf.in');
int chemical2020,v100,d100,t100,n,ns;
void Citiré
int x,y,cost;
fgt;gt;ngt;gt;ns;
for (int we=1; ilt;=d; i)
fór (int m=1; jlt;=n; j)
if (ij)
cij=0;
else
cij=1000;
while (fgt;gt;xgt;gt;ygt;gt;price)
cxy=cost;
void InitializareV (int sixth is v20, int n, int back button)
fór (int i=1; ilt;=d; i)
if (ix)
vi=1;
else
vi=0;
gap InitializareD (int chemical2020, int d20, int n, int back button)
fór (int we=1; ilt;=d; i actually)
di=cxi;
gap InitializareT (int d20, int x)
fór (int we=1; ilt;=n; i)
if (di!=0 and di!=1000)
ti=x;
gap Minim (int ámp;dmin, int ámp;t)
dmin=1000;
for (int i actually=1; ilt;=n; we)
if (vi0 ánd di!=0)
if (dilt;dmin)
dmin=di;
k=i;
gap Dijkstra
int x,y,k,dmin;
a=ns;
lnitializareV (v,n,x);
lnitializareD (c,d,n,x);
lnitializareT (m,x);
for (int i=1; ilt;=d; we)
Minim (dmin,k);
vk=1;
for (int j=1; jlt;=in; l)
if (vj0)
con=dmin+ckj;
if (ylt;dj)
dj=y;
tj=k;
gap Afisare (int con)
int e=ty;
if (k!=0)
Afisare(k);
coutlt;lt;klt;lt;' ';
int main
Citiré;
Dijkstrá;
fór (int i actually=1; ilt;=in; i actually)
coutIt;lt;'Distanta minimá de la :'It;lt;nslt;It;' la 'lt;It;ilt;lt;': 'It;lt;dilt;It;' traseul éste:';
Afisaré(i actually);
coutlt;lt;ilt;lt;endl;
come back 0;