2 条评论

  • @ 2016-05-08 13:45:28

    var 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.

  • @ 2016-05-08 13:45:27

    var 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
分类
(无)
标签
递交数
1852
已通过
785
通过率
42%
被复制
15
上传者