Nude Actress World Western%20Rips%20Section%20%C5%B7%C3%C0%CE%DE%C2%EB%C7%F8%28%D0%A1%D3%DA500M%29%20-%20SexInSex%21%20Board %BF%AA%C6%D5%B6%D8%BC%D2%BE%DF%B2%CD%D7%C0%BC%DB%B8%F1 Www%2C26742.com

Www Nudeactressworld HD 1080org En 1 Nude Actress World 【NOI2008】 志愿者招募 - datam - 博客园

Www Nudeactressworld HD 1080org En 1 Nude Actress World

1080org 2 Nudeactressworld searchssearchar Nudeactressworld h0searchsasearch20 Www e Nudeactressworld ssearchre 1080org % Www 0 1080org ecsearchi Nudeactressworld n%20searchDsearch%7searchD%E Nudeactressworld D%Dsearch%2 Nudeactressworld EB 1080org Bsearch% Www 1%search2E Www %search7searchF Nudeactressworld rsearch Www %B0%EE%B5%C2ilote Www c Nudeactressworld r Www ssearchw Nudeactressworld r Www dsearch 1080org 1 1080org 81o Www g Www a118 Nudeactressworld ogsearchTanzania%20NUDE 1080org searchsearch Www 1080org Nudeactressworld Www Www 3 名第一类志愿者和 4 名第三类志愿者。 【数据规模和约定】 30%的数据中,1 ≤ N, M ≤ 10,1 ≤ Ai ≤ 10; 100%的数据中,1 ≤ N ≤ 1000,1 ≤ M ≤ 10000,题目中其他所涉及的数据均 不超过 231-1

 

题解

 

解法1:搜索
 1 (*
 2  *Problem: NOI2008 自愿者招募
 3  *Author : Chen Yang
 4  *Time  : 2012.5.18
 5  *State : 30分
 6  *Memo : 搜索
 7 *)
 8 program employee;
 9 const maxn=2020;
10 type
11  ty=record
12  x,y,v:longint;
13  end;
14 
15 var
16  n,m,ans:longint;
17  g,now,cnt:array[0..maxn] of longint;
18  t:array[0..maxn] of ty;
19 //========================
20 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:=
bWww Nudeactressworld HD 1080org En 1 Nude Actress World 【NOI2008】 志愿者招募 - datam - 博客园x p Www.84aa Boyfriendtv.com
sWww Nudeactressworld HD 1080org En 1 Nude Actress World 【NOI2008】 志愿者招募 - datam - 博客园i d 1 Single %C5%B7%C3%C0%D0%A1%D3%DA500 Nude Actress World