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

Why WA???
Posted by snipious 28 Jan 2005 19:39
const kmax = 101;
var n, n2, k, t, i, j: byte;
    a: array[1..kmax] of byte;
begin
     read(k);
     for i := 1 to k do
         read(a[i]);
     for i := 1 to k - 1 do
         for j := 1 to k - i do
             if a[j] > a[j + 1] then begin
                t := a[j];
                a[j] := a[j + 1];
                a[j + 1] := t;
             end;
     n := 0;
     for i := 1 to k div 2 + 1 do
         inc(n, a[i] div 2 + 1);
     write(n);
end.
Type 'byte' seems to be not enough (-)
Posted by Dmitry 'Diman_YES' Kovalioff 28 Jan 2005 20:38