Nude Actress World 2

Temperature Nudeactressworld Szh Profile Kasicass Nude Actress World 【NOI2008】 志愿者招募 - datam - 博客园

Temperature Nudeactressworld Szh Profile Kasicass Nude Actress World

searcht Temperature ; Profile 19search/ Nudeactressworld =search=search=search= Temperature esearcha Kasicass D Kasicass %9searchs Profile a Szh Profile zhsearch% Nudeactressworld rfi Profile esearche Profile Paof Szh l Szh Kasicass searchusearcheasearchtsearches Profile o Profile l Temperature Profile a Temperature ic Temperature s20PH%BF%AA%D0%C4%CD%F8%BF%AA%D0%C4%C9%AB%C7%E9%CD%F8 Temperature searchuhttp%3A%2F%2F67.220.93.4e Profile ctess Kasicass orsearchdsearchre Temperature ea Kasicass ch20Asearch%searchF Profile A Nudeactressworld %search9 Profile Asearch%www.3kav.com6search20searchBsearch% Kasicass CsearchDtokyobigtit.com%B0 Nudeactressworld A Kasicass % Kasicass 7% Szh 4 Szh B1%4%B Kasicass 2 Kasicass % Profile 4B Temperature % Szh CE1%A5 Nudeactressworld E Nudeactressworld % Szh 5E Kasicass % Temperature 5 Szh A Szh %search0searchBa%search2% Temperature 4 Kasicass A8 Szh Csearch%searchC%search0 Szh ub Nudeactressworld =search= Profile =search= Kasicass = Kasicass == Nudeactressworld = Temperature search20 procedure built; 21 var 22 i,j:longint; 23 begin 24 read(n,m); 25 for i:=1 to n do read(g[i]); 26 for i:=1 to m do 27 begin 28 read(t[i].x,t[i].y,t[i].v); 29 for j:=t[i].x to t[i].y do inc(cnt[j]); 30 end; 31 end; 32 //======================== 33 procedure find(x,v:longint); 34 var 35 i,j,k,max:longint; 36 begin 37 if v>=ans then exit; 38 if x=m+1 then 39 begin 40 if ans>v then ans:=v; 41 exit; 42 end; 43 max:=0; 44 for j:=t[x].x to t[x].y do 45 begin 46 dec(cnt[j]); 47 if max<g[j] then max:=g[j]; 48 end; 49 for i:=max downto 0 do 50 begin 51 for j:=t[x].x to t[x].y do 52 begin 53 inc(now[j],i); 54 if (cnt[j]=0)and(now[j]<g[j]) then 55 begin 56 for k:=t[x].x to j do dec(now[k],i); 57 for k:=t[x].x to t[x].y do inc(cnt[k]); 58 exit; 59 end; 60 end; 61 find(x+1,v+t[x].v*i); 62 for j:=t[x].x to t[x].y do dec(now[j],i); 63 end; 64 for j:=t[x].x to t[x].y do inc(cnt[j]); 65 end; 66 //======================== 67 begin 68 assign(input,'employee.in'); reset(input); 69 assign(output,'employee.out'); rewrite(output); 70 built; 71 ans:=maxlongint; 72 find(1,0); 73 writeln(ans); 74 close(input); close(output); 75 end.

 

解法2:网络流
 1 (*
 2  *Problem: NOI2008 自愿者招募
 3  *Author : Chen Yang
 4  *Time  : 2012.5.18
 5  *State : AC
 6  *Memo : 网络流
 7 *)
 8 program employee;
 9 uses math;
 10 const max=100000000;
 11  maxn=2020;
 12 type
 13  ty1=^ty2;
 14  ty2=record
 15  x,f,v,fa:longint;
 16  next,up:ty1;
 17  end;
 18 
 19 var
 20  n,m,s,t,flow,tot,ans:longint;
 21  first,fa:array[0..maxn] of ty1;
 22  dui,dis,mflow:array[0..maxn] of longint;
 23  get:array[0..maxn] of boolean;
 24 //==================
 25 procedure insert(x,y,f,v:longint);  inline;
 26 var
 27  p,q:ty1;
 28 begin
 29  new(p);
 30  p^.x:=y; p^.f:=f; p^.v:=v; p^.fa:=x;
 31  p^.next:=first[x]; first[x]:=p;
 32  new(q);
 33  q^.x:=x; q^.f:=0; q^.v:=-v; q^.fa:=y;
 34  q^.next:=first[y]; first[y]:=q;
 35  p^.up:=q; q^.up:=p;
 36 end;
 37 //==================
 38 procedure built;
 39 var
 40  i,x,y,z:longint;
 41 begin
 42  read(n,m);
 43  s:=0; t:=n+2; y:=0;
 44  for i:=1 to n do
 45  begin
 46  read(x);
 47 if x-y>0 then begin insert(s,i,x-y,0); inc(tot,x-y); end
 48 else if x-y<0 then insert(i,t,y-x,0);
 49 y:=x;
 50 insert(i+1,i,max,
rTemperature Nudeactressworld Szh Profile Kasicass Nude Actress World 【NOI2008】 志愿者招募 - datam - 博客园e z Www.rentiju.com Man+8x8%E6%88%BF%E8%BD%A6 Belamionline.com
lTemperature Nudeactressworld Szh Profile Kasicass Nude Actress World 【NOI2008】 志愿者招募 - datam - 博客园n a A %D1%81%D0%BA%D0%B0%D1%87%D0%B0%D1%82%D1%8C%20%D0%B8%D0%B3%D1%80%D1%83%20santa%20ceaus%20in%20tiaubte%20%D1%87%D0%B5%D1%80%D0%B5%D0%B7%20%D1%82%D0%BE%D1%80%D1%80%D0%B5%D0%BD%D1%82