vj1119 Car的旅行路线

Vj1119 Car的旅行路线

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
//dijkstra //½¨Í¼·Ö³ÇÄںͳÇÍâ ÕÒ¾ØÐεÚËĸö¶¥µãÓõã»ý ¿´ÄÄÁ½Ìõ±ßÊÇ´¹Ö±µÄ ºóÔÙ×öÏòÁ¿¼Ó·¨µÃµÚËĵã×ø±ê º //дË㷨ҪдƽʱдÊìÁ·µÄ ±ðÁÙʱÍæ¸Ä¶¯ / const maxn=400; var n,s,t,numa,numb:integer; ans:real; f:array[0. .maxn,0. .maxn] of real; x,y:array[0. .maxn] of integer; cost:array[0. .maxn] of real; v:array[0. .maxn] of boolean; function min(x,y:real):real; begin if x<y then exit(x); exit(y); end; function min(x,y,z:integer):integer; begin if (x<=y) and (x<=z) then exit(x); if (y<=x) and (y<=z) then exit(y); exit(z); end; function max(x,y,z:integer):integer; begin if (x>=y) and (y>=z) then exit(x); if (y>=x) and (y>=z) then exit(y); exit(z); end; function dist(i,j:integer):real; begin exit(sqrt(sqr(x[i]-x[j])+sqr(y[i]-y[j]))); end; function calc(i,j,k:integer):integer; begin exit((x[j]-x[i])*(y[j]-y[i])+(x[k]-x[i])*(y[k]-y[i])); end; procedure init; var i,j,k,ti:integer;
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

Vj1119 Car&ccedil;š„&aelig;—…&egrave;&iexcl;Œ&egrave;&middot;&macr;&ccedil;&ordm;&iquest;

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online