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 1025. Democracy in Danger

I don't know where is wrong. ( Pascal )
Posted by Babin Alexander 14 Oct 2016 19:51
Wrote on Pascal:

var
  i, j: integer;
  ms, a, b: integer;
  arrg: array of integer;
begin
  Read(ms);
  SetLength(arrg, ms);

  for i := 0 to arrg.Length - 1 do begin
    var temp: integer;
    Read(temp);
    arrg[i] := temp;
  end;

  for j := 1 to arrg.Length - 1 do
    for i := 1 to arrg.Length - j do
      if arrg[i - 1] > arrg[i] then
        Swap(arrg[i - 1], arrg[i]);

  a := arrg.Length div 2;

  for i := 0 to a do
    b := b + arrg[i] div 2 + 1;

  Write(b);
end.

Wrong answer ( test 1 ).
Re: I don't know where is wrong. ( Pascal )
Posted by German 14 Oct 2016 22:41
arrg.Length it may be odd