CT26192

Galen's Middle Mark Ledger

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Galen runs the timber yard at the fen lights of Will-o-Wisp. Today the books show a list of weights, and the numbers must be worked out before sundown. Task: Print the lower median: the element at position floor((n-1)/2) after sorting (so for even n it is the smaller of the two middles). Input format: First line: n. Second line: n integers. Output format: Print the lower median. Constraints: 1 <= n <= 297; -1000000000 <= a[i],x <= 1000.

Example 1:

Input: 163 -835705813 -755071591 -674497840 -470084896 -733619696 -18656328 -719716763 -898135342 -554210727 -53358367 -314109088 -474523876 -672966598 -413877265 -326676329 -804018450 -831418998 -282252193 -90984385 -405949327 -917594789 -844023157 -17826972 -256799352 -695902562 -737831373 -180782607 -96851315 -150293524 -339786816 -613831058 -272687821 -551000641 -818754098 -289548270 -413448910 -218598990 -207332213 -647428736 -891236216 -695834085 -571785261 -24946520 -305916563 -586709701 -768703850 -118549995 -42224486 -977512607 -334184479 -276226944 -320513702 -256312863 -842828111 -21099469 -528797173 -710900007 -240325740 -481656257 -83036080 -196304844 -779388286 -959967384 -92509801 -509788559 -999807289 -380980671 -377888430 -137455911 -899645922 -315686102 -329474426 -450011655 -789583211 -749711409 -992225161 -421184612 -695008856 -779865674 -536310759 -550659039 -254422215 -969240755 -172777700 -520394960 -709330790 -580144483 -270118160 -149318912 -25213216 -128681044 -150974947 -342424178 -747830364 -867158443 -195076040 -258196922 -643902297 -284444273 -940475970 -571776016 -517320104 -945621875 -439408557 -552389703 -470086038 -196568197 -343876708 -135444206 -946097728 -66037443 -703830381 -25139313 -947992127 -404145061 -739148745 -646313396 -239780991 -48801983 -175621487 -765465181 -173591237 -630666550 -185976902 -334935116 -346239250 -223502856 -629220721 -249344887 -834470771 -470729114 -795615256 -668443928 -747189026 -26303841 -169644068 -581412440 -149899015 -108480034 -361796101 -519947830 -300938932 -791656232 -676142308 -886024760 -79305759 -881727541 -312555466 -939807949 -845186783 -286838346 -80501674 -641691428 -820492936 -274340863 -729583324 -371397079 -456574066 -107404375 -329542129 -499436178 -245534679 -467945307
Output: -456574066

Example 2:

Input: 260 -293066617 -982652831 -720700463 -829600436 -521592425 -631179767 -716906883 -416419483 -966670106 -935327322 -10866792 -754807295 -60996744 -186939915 -791105631 -628584701 -193390024 -126675930 -827598529 -562273631 -933995110 -790793670 -262107014 -861769407 -510084705 -417697959 -952110493 -193878371 -747813962 -458385771 -742209489 -417494516 -200515582 -883074263 -322239097 -404697099 -191544833 -13016890 -210015998 -581887322 -800181207 -646140735 -623293391 -216887585 -811252175 -399708145 -989115076 -239666011 -114714405 -70663226 -41846424 -867021737 -518082918 -743215642 -488894965 -189542058 -469557650 -109743040 -423052060 -188613330 -47701353 -728363462 -515285871 -547945063 -275891088 -935078382 -743325485 -100341335 -373315341 -872297813 -533009835 -884376479 -536125005 -998799699 -42018180 -367632113 -873639853 -248742201 -196524571 -308480751 -921299922 -337071384 -793290052 -193166436 -307501955 -299135693 -859450650 -865895215 -189074617 -763651149 -305837876 -733710787 -680461913 -415639863 -377351758 -544859940 -413793100 -119343267 -239213901 -420276188 -286412389 -909186508 -257014343 -186043995 -927883621 -248345551 -257023613 -681998958 -657602158 -300667990 -992373636 -613205995 -877116998 -874940937 -63052633 -154325323 -804961658 -545474285 -113409935 -643103942 -870830014 -231007882 -905955553 -82848398 -233438067 -303820857 -936896379 -842396205 -17393421 -214122382 -5766581 -490843861 -547999786 -193678679 -687156861 -963518294 -245675447 -321437077 -433432909 -951475918 -902861434 -45633598 -223440082 -970433253 -562925370 -592364689 -777398389 -202633710 -420922025 -26078807 -2211165 -619836531 -549786115 -320847637 -137778813 -229240271 -324376340 -699126187 -201786408 -563409641 -141820905 -396239930 -599602841 -22662399 -364662558 -636109168 -162827314 -220735117 -554800417 -541689667 -696979178 -573661164 -663861697 -62764650 -995476899 -446143161 -954470193 -579753456 -773915528 -346133756 -488085686 -294202958 -55485548 -973761671 -97424380 -196822230 -575441075 -504933930 -362944662 -246700128 -721302749 -965129916 -585448473 -427204468 -475564512 -519928859 -465559192 -522033358 -192620362 -561240771 -231032890 -798020326 -400696685 -462886818 -618826497 -16205127 -69053776 -146990210 -925568627 -675655620 -163687989 -717762287 -106165550 -162356682 -922598590 -164342674 -559818424 -283309448 -138258520 -306080127 -134921707 -657738788 -804981469 -115464739 -527421414 -673691963 -644889132 -923794181 -920667780 -187006174 -306734283 -319158130 -81752260 -168644653 -259802688 -387576673 -936804714 -373950927 -52923452 -49942896 -450510988 -797367727 -286227583 -31132155 -20472803 -211834810 -442747391 -698880328 -713742716 -114175038 -549120863 -209236585 -648094085 -239007129 -48923713 -560265478 -284767236 -85609043 -944722235 -856157286
Output: -446143161

Example 3:

Input: 143 -426747765 -49533330 -488478290 -929325493 -581001939 -229005145 -420807753 -371176130 -972477950 -898075012 -685062685 -343576619 -942924203 -464628677 -902996852 -974086519 -721586642 -214955051 -130760645 -943157942 -222713814 -821339525 -638317989 -645048359 -180587300 -191842878 -918173403 -868801003 -836124761 -872548639 -234318491 -565782931 -607034247 -797986759 -202921614 -404913654 -285156197 -227688177 -126113412 -171917296 -210734493 -711253733 -950647075 -1002332 -754620934 -702792649 -612522969 -803582609 -826380161 -331390981 -903395953 -868628693 -756300143 -957587900 -769832686 -337869467 -860897316 -223351773 -587033212 -760949579 -112945126 -598784642 -654269165 -63176058 -443723170 -880516367 -971111018 -267743760 -788527548 -555297579 -155644209 -342280889 -591467420 -454633168 -768891205 -17592670 -721622717 -879412702 -466142020 -702789043 -528392524 -419966013 -475921627 -581633997 -372986033 -42291974 -266621457 -335625605 -466813803 -36955135 -392956764 -745306360 -550252928 -852852549 -873400396 -250616298 -807505080 -368772387 -777774752 -386515140 -471957438 -37630245 -146308000 -794871589 -354708861 -316202070 -685352054 -442729955 -937931766 -688706925 -87064958 -407276277 -969245991 -354832740 -788150204 -716551862 -97160710 -478349967 -917311910 -153449688 -474184502 -126191688 -470914312 -478431849 -39961466 -756780479 -982086509 -166704070 -903189517 -200571052 -71284162 -392376797 -750563383 -764899490 -761995173 -885803773 -978228510 -53139935 -157338510 -312542742 -493704765 -481222261 -977963960
Output: -493704765

Constraints:

1 <= n <= 297; -1000000000 <= a[i],x <= 1000.

Loading...
Test Cases:No test cases
No test cases available.