vj1313 金明的预算方案

Vj1313 金明的预算方案

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
//±ÉÈ˵ķ½·¨ //dp //¶ÔÓÚÿ¸öÖ÷¼þ¶¼ÓÐ 4 ÖÖÑ¡ÔñÇé¿ö //Ñ¡Ö÷¼þ ´øÒ»¸ö¸½¼þ ´øÁ½¸ö¸½¼þ / const maxm=60; maxn=32000; var n,m,num:integer; f:array[0. .maxn] of longint; v,p:array[0. .maxm,0. .2] of integer; procedure init; var i,t,x,y:integer; begin readln(n,m); for i:=1 to m do begin readln(x,y,t); if t=0 then begin v[i,0]:=x; p[i,0]:=y; end else begin if v[t,1]=0 then begin v[t,1]:=x; p[t,1]:=y; end else begin v[t,2]:=x; p[t,2]:=y; end;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.
Ask a homework question - tutors are online