|
|
back to boardWA #7 What is the trick of problem 7? I tried a file of 250000 numbers 2^31-1 and got the answer 2147483647.0 So this is right. I tried 1 0 and got 0.0 There was no TLE but a wrong answer. Re: WA #7 This is a piece of my code Something is still wrong CreatePQueue(a); // creates a priority queue readln(N); for i:=1 to (N div 2) + 1 do begin readln(j); PriorityEnq(a,j); //push the number end; for i:= (N div 2) + 2 to N do begin readln(j); PriorityEnq(a,j); //push the number PriorityDeq(a,k); //pop the greatest end; if odd(N) then begin PriorityDeq(a,k); //pop the gratest s:=k; writeln(s:0:1); end else begin PriorityDeq(a,l); PriorityDeq(a,k); s:=l+k; writeln(s/2:0:1); end; |
|
|