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 wrong answer???????
Posted by Misha 12 Mar 2003 18:48
Why wrong answer???????


Type Vector = array [1..101] of Integer;
Var a: Vector; k,i,u,min,R,p,o : Integer;
Begin
Readln (k);
For i:=1 to k do
Read (a[i]);
u:=1;
while (u<=k) do begin
min:=a[u];
for i:=u to k do
if a[i]<min then begin min:=a[i]; p:=i; end;
R:=a[u];
a[u]:=min;
a[p]:=R;
u:=u+1;
end;
k:=k div 2+1;
o:=0;
for i:=1 to k do begin
a[i]:=round(a[i]/2);
o:=o+a[i];
end;
write (o);
end.
Re: Why wrong answer???????
Posted by Saber 12 Mar 2003 19:44
use Div 2 instead of round ...