CT25239

The Ivory Middle Mark

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Every season at the peat bogs of Mossgrieve, someone must decode the foreman's shorthand notes. This year the task falls to Bhavi, armed only with the weights register. 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 <= 351; -1000000 <= a[i],x <= 1000000000.

Example 1:

Input: 51 963379362 468307315 115091938 881563293 781525010 888716282 752817222 349434938 297212661 379713695 676222910 285071805 510600170 203509179 184497164 626320188 3183413 810618046 163194286 837822713 438874527 467934528 918926470 824768628 684435518 755118383 282633531 775502152 757578786 157610651 628843200 451429691 52126319 906875716 161841191 816078674 12184162 581697147 476662669 309396179 544506213 915354985 538769708 850088849 229677724 46057777 370389059 616659582 363388500 105132637 942126371
Output: 510600170

Example 2:

Input: 122 35094887 196142310 819977923 76753778 795703312 290164643 567435353 887777189 488286123 455519323 134441730 921198227 933768268 807314218 12722756 537155674 665018564 538874388 357019147 234159548 424130692 318114200 785038675 638047952 346978954 395121479 55755282 991208542 597705319 944499910 150623459 652834380 89501217 57636360 582486043 798768917 953013297 513631036 290884358 144685259 281185759 461606352 609368418 135526606 305220905 824153450 659701815 442452733 656318748 584592822 654207988 455316413 907127952 354971109 594397007 813582562 545400783 799856459 247650397 215435186 404337536 108310253 87890575 994978636 311150674 976322021 700666929 291934455 182642678 116045824 765888280 9515816 557210342 490980705 256950026 589908886 626393557 371785453 944115073 700865919 59693…
Output: 513631036

Example 3:

Input: 83 763569937 378926483 50553331 364173432 713611316 748635808 658690777 735063495 96970482 90834052 42461148 887219381 930412028 701388591 566132233 346010295 565077524 597909773 304046554 455453098 292713369 803886311 36182619 637055595 914971649 209157725 316684722 925242592 199772329 867869568 498582803 529612708 491811983 428038474 476739250 560983521 393817424 908379966 207576492 770922956 869362744 168376446 553277177 611085594 848363805 636230731 260488166 721834401 222400351 577011958 417728675 379674644 561532175 29181356 666825043 387245567 415241455 884391818 62792507 612806125 761432637 303765741 681866785 898237965 507071378 752099327 582019190 886668483 801709564 952694510 340684213 370205941 156318361 436666545 703563913 263607283 271857797 863004412 583564990 973074465 4862…
Output: 553277177

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The Ivory Middle Mark - EASY Coding Problem | CodeTikki