ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1787. Turn for MEGA

Wr.Answ 3
Posted by dickbooster 21 Oct 2011 20:02
wtf?
what`s wrong?

program asd;
var n,k,i:byte;
    r:word;
    a:array[1..100] of byte;
BEGIN
r:=0;
ReadLn(k,n);
for i:=1 to n do
begin
 Read(a[i]);
 if (r+a[i]-k)>=0 then r:=r+a[i]-k
 else r:=0;
end;
WriteLn(r);
END.
Re: Wr.Answ 3
Posted by vladik.kopilash 14 Jan 2012 01:00
Hi
array must be [1..101] because you need to put the latest integer into this cell
Re: Wr.Answ 3
Posted by Logan`~ 14 Sep 2018 20:33
попробуйте
5 5
0 0 0 0 0