|
|
вернуться в форумWA#13 FreePascal Послано Desire 2 ноя 2013 04:20 Here is my code. What is wrong? Help, please! var m,n:int64; k,i:0..20; a:array[1..20] of int64; begin read(n,k); for i:=1 to k do read(a[i]); for i:=2 to k do if a[i]<a[i-1] then begin m:=a[i]; a[i]:=a[i-1]; a[i-1]:=m end; m:=n-(n-a[1])-(n-a[2]); if m<=0 then write(0) else write(m); end. Edited by author 02.11.2013 04:21 Re: WA#13 FreePascal You must only write((a1+a2+...+ak)-n) That's all)) Good luck! Re: WA#13 FreePascal Послано Sergey 14 янв 2016 04:03 no, right answer is ((a1+a2+...+ak)-n * (k-1)) |
|
|