CT23021

Last weights of Iker

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

At the ember dunes of Ashfall, Iker records each weights in a worn leather ledger. The guild wants answers, not guesses. 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 <= 664; -1000000 <= a[i],x <= 1000.

Example 1:

Input: 262 -118214 -303854 -168556 -383527 -155173 -221571 -197813 -257495 -138389 -183863 -53368 -826833 -42179 -140077 -391803 -269434 -586674 -661591 -486142 -278966 -559086 -644934 -700637 -810248 -549970 -442264 -102453 -962262 -927502 -864214 -148080 -905551 -289165 -273737 -703343 -902268 -900344 -286621 -790118 -214938 -816482 -336971 -532671 -347463 -807834 -27555 -206665 -197506 -455754 -208888 -385074 -514577 -748625 -582469 -525211 -140195 -526218 -980217 -75626 -661811 -104898 -275831 -998821 -729788 -257728 -225641 -296870 -667831 -658299 -845589 -421701 -335995 -487217 -296857 -309827 -424833 -972866 -454302 -896170 -338538 -603807 -766215 -491941 -112799 -316124 -139048 -833328 -205321 -586610 -9670 -695925 -347426 -957695 -186369 -431048 -915851 -799588 -732033 -659145 -647241 -8…
Output: -474404

Example 2:

Input: 566 -280823 -936152 -208953 -744120 -664380 -442679 -805404 -366994 -431252 -570277 -643283 -98232 -297814 -97994 -934917 -654646 -251473 -85316 -169115 -179027 -551939 -712147 -458595 -850311 -339654 -985570 -170491 -523529 -682426 -618290 -88644 -623624 -729763 -377683 -448404 -285707 -587408 -236963 -486270 -632370 -887811 -679475 -613507 -395140 -988954 -74331 -605082 -486397 -582809 -141619 -406902 -487610 -409671 -599223 -894998 -197954 -617675 -305519 -346172 -622822 -859855 -186097 -200681 -341642 -994741 -205786 -45574 -389713 -501795 -474339 -827561 -757943 -926421 -686166 -452455 -110423 -449843 -49186 -720153 -371765 -851574 -892454 -491878 -833891 -694739 -458131 -866748 -616393 -130015 -778781 -371893 -707138 -398663 -741408 -126075 -950096 -724626 -30964 -51221 -314561 -5550…
Output: -492174

Example 3:

Input: 464 -690609 -376286 -342080 -826187 -806419 -415826 -573050 -648230 -566027 -185792 -492641 -503680 -244775 -431761 -288678 -9435 -830817 -969416 -302811 -257403 -465030 -421211 -194003 -350400 -637945 -34093 -733664 -773567 -974890 -365922 -863139 -589770 -518651 -215616 -805132 -530868 -810248 -661285 -888735 -965576 -922039 -277376 -840149 -8205 -16624 -368673 -282450 -813058 -118850 -182665 -976120 -740811 -361404 -713465 -946341 -868928 -700627 -228723 -751763 -700896 -739198 -570998 -982089 -678584 -253367 -80161 -83414 -399782 -200453 -102995 -291148 -286986 -693211 -262987 -236749 -273123 -520752 -682421 -233753 -183343 -721045 -201956 -174759 -624957 -793583 -279536 -363478 -82260 -930036 -700988 -673176 -460283 -324233 -103815 -226761 -625797 -942369 -488934 -230739 -852692 -7183…
Output: -492631

Constraints:

1 <= n <= 664; -1000000 <= a[i],x <= 1000.

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