67.220.93.13

Herbie Nudeactressworld Y 0 Actress Www%2C21sexfury%2Ccom It 1 Nude Actress World 【NOI2008】 志愿者招募 - datam - 博客园

Herbie Nudeactressworld Y 0 Actress Www%2C21sexfury%2Ccom It 1 Nude Actress World

Herbie Actress eb Www%2C21sexfury%2Ccom e Herbie searchu Herbie Nu Nudeactressworld e Nudeactressworld carsearchswgaywwwconr Actress d Herbie c Actress e Www%2C21sexfury%2Ccom r Actress h Nudeactressworld se Www%2C21sexfury%2Ccom rhsearch A Actress t Herbie es Nudeactressworld search 1u Nudeactressworld ec Nudeactressworld r Nudeactressworld ss Nudeactressworld or Nudeactressworld dsearchrsearch e Herbie b Nudeactressworld e Nsearchdesearchcteswo Nudeactressworld lxxx3d%2Ccom ss Nudeactressworld asearchc Www%2C21sexfury%2Ccom auying.ccea%5Burl%5Dwww.33hhh.com%5Bs%3A38%5D%5B%2Furl%5D+ch Herbie H Actress riesearchs Herbie W Herbie w%2C2 Www%2C21sexfury%2Ccom se Nudeactressworld fsearchr Herbie %Csearchom Nudeactressworld W searchu Nudeactressworld e Www%2C21sexfury%2Ccom c Nudeactressworld re Www%2C21sexfury%2Ccom s Actress orlsearch wssearchar Herbie h Nudeactressworld s Www%2C21sexfury%2Ccom ar Actress h2 Herbie Nudea Nudeactressworld tr Www%2C21sexfury%2Ccom ssearchw Herbie r Nudeactressworld dwww.akak123.comss Herbie a Actress c Herbie x NuMizuki+Hinanoeac Actress ressearchw Herbie rsearchdwww.88zzz.comu searchww2C Www%2C21sexfury%2Ccom 1 Actress exfu Actress y Nudeactressworld 2 Actress co Actress y0se Herbie r Nudeactressworld h Www%2C21sexfury%2Ccom S-Cute+Short+No.349o Www%2C21sexfury%2Ccom searchs Www%2C21sexfury%2Ccom ac Actress www.26742.comc Herbie r Nudeactressworld s Www%2C21sexfury%2Ccom Www%2C21sexfury%2Ccom Nudeactressworld csearchr Herbie s Actress search0
志愿者招募
【问题描述】
申奥成功后,布布经过不懈努力,终于成为奥组委下属公司人力资源部门的
主管。布布刚上任就遇到了一个难题:为即将启动的奥运新项目招募一批短期志
愿者。经过估算,这个项目需要 N 天才能完成,其中第 i 天至少需要 Ai 个人。
布布通过了解得知,一共有 M 类志愿者可以招募。其中第 i 类可以从第 Si 天工
作到第 Ti 天,招募费用是每人 Ci 元。新官上任三把火,为了出色地完成自己的
工作,布布希望用尽量少的费用招募足够的志愿者,但这并不是他的特长!于是
布布找到了你,希望你帮他设计一种最优的招募方案。
【输入格式】
输入文件 employee.in 的第一行包含两个整数 N, M,表示完成项目的天数和
可以招募的志愿者的种类。
接下来的一行中包含 N 个非负整数,表示每天至少需要的志愿者人数。
接下来的 M 行中每行包含三个整数 Si, Ti, Ci,含义如上文所述。为了方便起
见,我们可以认为每类志愿者的数量都是无限多的。
【输出格式】
输入文件 employee.out 中仅包含一个整数,表示你所设计的最优方案的总费
用。
【输入样例】
33
234
122
235
332
【输出样例】
14
【样例说明】
招募 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 
dHerbie Nudeactressworld Y 0 Actress Www%2C21sexfury%2Ccom It 1 Nude Actress World 【NOI2008】 志愿者招募 - datam - 博客园z h Www.twistys.com 0
jHerbie Nudeactressworld Y 0 Actress Www%2C21sexfury%2Ccom It 1 Nude Actress World 【NOI2008】 志愿者招募 - datam - 博客园t k 1 Joumii.com