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 1510. Order

Sort and Output element n/2
Posted by ░▒ Nguyễn Kim Vỹ ▒░ 19 Jul 2010 14:54
this algo with O(n*log(n))
but i don't know why WA on Test21, please help me!

[code deleted]

Edited by moderator 24.11.2019 13:39
Re: Sort and Output element n/2
Posted by Cebiyev Ferhad 21 Jul 2010 16:10
Your mistakes:
a[100001] must be a[500001]
a[(n-1)/2] must be a[(n+1)/2]
qsort(a,n,sizeof(int),compare) must be qsort(a,n+1,sizeof(int),compare).

So AC is here:
[code deleted]

Edited by moderator 24.11.2019 13:38