CT22732

Marek's Silver vials

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Marek runs the depot at the mushroom groves of Fungaldeep. Today the books show a list of vials, 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 <= 709; -1000000000 <= a[i],x <= 1000.

Example 1:

Input: 528 -253797770 -469671011 -971024076 -482632016 -949556584 -56846547 -597927025 -198810675 -210132250 -531800847 -830404057 -926984551 -787753180 -157455190 -754615335 -702435816 -356257789 -732242300 -595681098 -78844273 -480296766 -545470740 -750409596 -540448374 -556336898 -210301071 -508655960 -828027129 -4533320 -24438143 -57545196 -644222166 -313146826 -541558627 -755545812 -731776125 -326184573 -946894057 -704585433 -937448283 -246732245 -344942443 -3044474 -811057221 -286496475 -345243415 -985674570 -533708610 -162221765 -647537321 -420165039 -261508031 -62741246 -330139662 -672825144 -696494713 -531124590 -427353122 -373789883 -741570416 -849435688 -494315296 -244365761 -259372966 -182757928 -22788576 -43465862 -475588768 -403968106 -575489139 -764490780 -532068011 -861677750 -197…
Output: -492868795

Example 2:

Input: 422 -488004238 -1994554 -545987412 -55771129 -499933745 -823365595 -100012847 -29592294 -115303531 -368240739 -209006092 -717871623 -56725226 -978533328 -531828807 -366402435 -941899696 -910755864 -549514771 -363073140 -82216662 -965051285 -454750841 -346961285 -738914448 -693499636 -94309567 -823477363 -200329357 -12226574 -434662784 -726949138 -893088095 -608430919 -670513377 -216991433 -212270647 -772826253 -778881781 -983801517 -761861762 -777647090 -396380719 -881978176 -308652918 -199915660 -270647694 -369524567 -185051370 -64848953 -871667824 -934244057 -938863105 -517542973 -974960018 -593327840 -480377071 -484103865 -957082237 -25189325 -755617395 -539646216 -675094897 -361537200 -779058507 -114049565 -25611953 -779938839 -153572601 -164455632 -258122817 -602093622 -807113602 -439…
Output: -486932283

Example 3:

Input: 85 -644004384 -183712385 -764008209 -694352100 -792260154 -448232362 -838194701 -687074818 -60816922 -544983798 -539559210 -612262958 -115615926 -664143679 -837620973 -307247578 -427206238 -307156165 -942504284 -960109725 -78519040 -786901403 -33421701 -526882538 -213854661 -614468822 -912283898 -986080989 -444563716 -680079330 -827342685 -603725466 -740940230 -31223031 -85714006 -731188497 -651621955 -983231494 -725128088 -862753959 -514155803 -769632316 -129542416 -927815196 -536018445 -124546483 -32364402 -371118953 -336793168 -5183767 -777816218 -563641663 -140905270 -6229617 -310947187 -597564230 -993504638 -555152879 -224299533 -460249823 -554557952 -572953104 -139604124 -530814138 -482197864 -944573836 -687278042 -677522982 -922198173 -607835374 -108777207 -140634133 -108262097 -709…
Output: -555152879

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Marek's Silver vials - EASY Coding Problem | CodeTikki