CT23095

The Middle Mark Beneath Prismhaven

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Morning light hits the glass towers of Prismhaven as Hugo unrolls the day's manifest of crates. The tally will decide the next shipment. 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 <= 516; -1000000 <= a[i],x <= 1000000.

Example 1:

Input: 412 679383 -71722 117214 -545828 42279 -97928 810647 393594 -842319 614208 -648995 322272 9837 -885674 -562059 -299085 613477 62685 -112571 644454 -710827 -192411 -920817 -561926 -583062 -788076 681102 108535 722024 565296 389079 -888657 -755811 -532709 -25094 -572964 -745700 -692879 -40273 57494 348844 -153367 243713 812601 -69878 -365141 507492 844253 885035 -54503 -540901 514979 -660136 587908 -956925 -457608 -951840 625926 866701 -865752 -745961 922349 728046 970894 623947 863763 87921 5144 948201 884615 277961 -402466 157676 116935 569277 961845 -11874 74897 339545 -924881 935804 -504993 -54823 -481722 -370521 -290332 -793691 -795528 335153 -547136 912524 49535 -879837 -42110 -33868 975414 6238 361585 183555 935622 541837 -278312 806209 168122 671693 413609 469137 748980 -581703 87253…
Output: -11169

Example 2:

Input: 483 -335911 -289938 -423042 684704 -629210 799713 496068 456560 989775 985623 943977 652705 -425652 807747 718966 605855 880505 -976996 -434222 -732868 84986 322828 893117 -463877 -899192 -703431 -300795 375141 -282271 -809034 726658 -96200 -176197 -836168 549134 811902 -213692 256100 -133319 -857529 -945466 -380873 54756 -339367 -787511 714109 -206783 -62210 -229886 -835518 -871621 76623 677664 -605923 -220463 944646 496541 -924283 687387 -481736 501584 668879 429097 894208 660929 128694 -65134 728880 885611 -785853 966545 -970083 951607 -219069 -497903 -989511 -925176 828846 -986593 88832 -753139 800628 369575 270276 530866 774998 897858 -283955 936853 164601 -942644 -695787 -715087 870046 381158 -179182 -341812 -228715 -687482 636944 27205 375737 -836726 433950 -34060 -595970 -897854 96…
Output: -24740

Example 3:

Input: 506 -397291 -786198 841458 63026 134337 800286 -553812 301512 880739 246009 -260326 -642068 88507 -226681 276703 -341817 -864110 590407 -145454 -902400 101006 581683 -694188 -100528 330084 -627547 -148103 305755 927181 212238 733986 353573 -859291 -111454 -677666 -638346 107371 758986 -324399 186706 629818 544684 134031 -682076 -314931 73356 -139332 928981 212024 466365 398300 -20213 -810282 -308252 906828 -628273 -697074 -989336 -619298 -655874 -957148 -27098 -78449 -869048 622338 -723731 -52689 915968 -483762 -798335 -821078 -686008 414835 535956 -560041 148362 903118 937203 -670001 5589 -847023 913316 22771 -443419 -223359 -801010 -641073 -354591 -501994 -895499 -941584 75284 -144761 947047 7938 -749700 231804 -399311 946150 31354 -611393 -831531 -745892 119175 -241485 -461249 -712928 -…
Output: 51863

Constraints:

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

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