# 2748: [HAOI2012]音量调节

## 2748: [HAOI2012]音量调节

Time Limit: 3 Sec  Memory Limit: 128 MB

Submit: 719  Solved: 475

[Submit][Status]

3 5 10 5 3 7

10

## HINT

1<=N<=50,1<=Ci<=Maxlevel 1<=maxlevel<=1000 0<=beginlevel<=maxlevel

## Source

1 var

```2    i,j,k,l,m,n,a1,a2,a3,a4:longint;
3    a:array[0..100,0..2000] of longint;
4 begin
6      fillchar(a,sizeof(a),0);
7      a[0,l]:=1;
8      for i:=1 to n do
9          begin
10               k:=0;
12               for j:=0 to m do
13                   begin
14                        if (j+a1)<=m then
15                           begin
16                                if a[i-1,j+a1]=1 then
17                                   begin
18                                        a[i,j]:=1;
19                                        k:=1;
20                                   end;
21                           end;
22                        if (j-a1)>=0 then
23                           begin
24                                if a[i-1,j-a1]=1 then
25                                   begin
26                                        a[i,j]:=1;
27                                        k:=1;
28                                   end;
29                           end;
30                   end;
31               if k=0 then
32                  begin
33                       writeln(-1);
34                       halt;
35                  end;
36          end;
37      for i:=m downto 0 do
38          if a[n,i]=1 then
39             begin
40                  writeln(i);
41                  halt;
42             end;
43 end.```

251 篇文章37 人订阅

0 条评论

## 相关文章

### 2924 数独挑战

2924 数独挑战  时间限制: 1 s  空间限制: 1000 KB  题目等级 : 钻石 Diamond 题解  查看运行结果 题目描述 Descripti...

2933

2694

3624

2172

2539

3957

1375

2255

2632

### 生理周期POJ 1006

Description 人生来就有三个生理周期，分别为体力、感情和智力周期，它们的周期长度为23天、28天和33天。每一个周期中有一天是高峰。在高峰这天，人会...

2757