0
已解决
程之行
高级守护
高级守护
var
m,n,l,r,mid,i:longint;
a:array [0..100000] of longint;
function ILGXT(d:longint):longint;
var
ans:longint;
begin
ans:=0;
for i:=1 to n do
ans:=ans+a[i] div d;
exit(ans);
end;
begin
r:=0;
l:=1;
readln(n,m);
for i:=1 to n do
begin
read(a[i]);
r:=r+a[i];
end;
while (l<=r) do
begin
mid:=(l+r) div 2;
if ILGXT(mid)>=m then l:=mid+1
else r:=mid-1;
end;
writeln(r);
end.
程之行在2018-04-04 21:46:39追加了内容
为什么错了