- 纪念品分组
- 2014-03-05 17:39:51 @
var
a:array[1..300] of longint;
b,c,d,e,f,t:longint;
g:boolean;
begin
fillchar(a,sizeof(a),0);
read(b,c);
t:=0;
for d := 1 to c do
begin
read(e);
inc(a[e]);
end;
while c>0 do
begin
f:=b;
inc(t);
while 0=0 do
begin
g:=false;
for d := f downto 1 do
if a[d]>0 then
begin
dec(a[d]);
f:=f-d;
g:=true;
dec(c);
break;
end;
if not g then break;
end;
end;
write(t);
end.
还有,什么时候才能公开输入输出啊。
3 条评论
-
贱人在我右边 LV 9 @ 2016-11-07 20:18:54
呵呵
-
2016-11-07 20:18:47@
其实很简单
-
2016-08-10 14:19:38@
有一些小错误
- 1