|
|
back to boardWA 10 /// What's wrong? var a,b,c,i,s:integer; m:array[1..1000000] of integer; begin s:=0; read(a); read(b); for i:=1 to b do begin read(m[i]); if(m[i]>a) then s:=s+m[i]-a else begin if s>m[i]+a then s:=s-m[i]-a else s:=0; end; end; if s<0 then writeln(0) else writeln(s); end. |
|
|