vj1101 传染病控制

Vj1101 传染病控制

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

View Full Document Right Arrow Icon
//±ÉÈ˵ķ½·¨ //ËÑË÷+×îÓÅ»¯¼ôÖ¦ //ÿ´ÎÀ©Õ¹Éϴδ«È¾µÄ½áµã¼ÓÈë¶ÓÁÐ °´¶ÓÁÐÖнáµãµÄ Éî¶È*½áµãÊý ½øÐÐÆÀ¹À ÏÈɾ³ý¹À¼Û ´óµÄ ÕâÑùËÑÏÂÈ¥Äܵõ½Ò»¸ö½ÏºÃµÄ½á¹û //Èç¹ûµ±Ç°¸ÐȾÈËÊý´óÓÚµ±Ç°×îÓŽâ ÔòÍ˳ö / //±ÉÈ˵ÄÎÊÌâ //×¢Òâ»ØËݺóɾ³ý±ê¼ÇÎÊÌâ / const maxn=300; var n,p,ans:integer; links,dep,nodes:array[0. .maxn] of integer; f:array[0. .maxn] of longint; son,list:array[0. .maxn,0. .maxn] of integer; link:array[0. .maxn,0. .maxn] of boolean; v:array[0. .maxn] of boolean; function max(x,y:integer):integer; begin if x>=y then exit(x); exit(y); end; procedure sort(k:integer); var i,j,t:integer; begin for i:=1 to list[k,0]-1 do for j:=i+1 to list[k,0] do if f[list[k,i]]<f[list[k,j]] then begin t:=list[k,i]; list[k,i]:=list[k,j]; list[k,j]:=t; end; end; procedure cnt(k:integer); var i:integer; begin v[k]:=true; for i:=1 to n do if not v[i] and link[k,i] then begin
Background image of page 1

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

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

This note was uploaded on 02/21/2011 for the course CS 001 taught by Professor 001 during the Spring '11 term at Shandong University.

Page1 / 2

Vj1101 传染病控制

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