- 接水问题
- @ 2016-05-07 08:59:23
// input code here **妈的智障**
1 条评论
- 
  sbsbsb LV 4 @ 2016-05-08 13:45:47var a:array[1..120] of longint; 
 b,i,k,j,n,m,x:longint;
 begin
 readln(n,m);
 for i:=1 to m do read(a[i]);
 for i:=m+1 to n do
 begin
 read(b);
 k:=1;
 for j:=2 to m do
 if a[j]<a[k] then k:=j;
 a[k]:=a[k]+b;
 end;
 x:=0;
 for i:=1 to m do
 if a[i]>x then x:=a[i];
 writeln(x);
 end.
- 1
信息
- ID
- 1811
- 难度
- 4
- 分类
- (无)
- 标签
- 递交数
- 1853
- 已通过
- 786
- 通过率
- 42%
- 被复制
- 15
- 上传者