CT26366

The Bronze vials of Brevin

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Every season at the herring shoals of Silverfin, someone must map a faster supply route. This year the task falls to Brevin, armed only with the vials 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 <= 820; -1000000 <= a[i],x <= 1000000000.

Example 1:

Input: 753 451870797 253455578 408409599 549071102 906616778 218417250 47084471 36468052 151642811 103812498 660818315 143072389 553785542 203630669 902584076 664222269 555565265 613115709 856610339 128397207 268111133 335792047 542909325 250835212 586942041 391003346 586249809 294521916 296177859 170260320 147932733 834233598 562075613 781644872 783677013 787304596 648076238 839931965 709294003 88475326 136944992 877463905 656902409 243883384 638085491 415894087 879381305 890474486 909467999 881000433 631976375 230778440 829245260 441965368 782854948 733746406 53897266 392440396 172327028 978974779 803158476 390475555 957364862 129028844 512090860 541806410 794806199 538932539 227298990 974784130 165008348 209359757 620358920 458995561 820780858 265072996 100314052 331410870 333997142 239438706 …
Output: 512314281

Example 2:

Input: 745 877354314 17845536 767282528 846665111 696391918 961806783 171676522 627450297 452578893 397773977 616710292 7448504 8546519 991313175 845518683 601870046 121609059 533359940 270534461 417765457 323511906 908517250 289317881 385237050 997675804 625893991 657718953 728500458 916950856 101677930 806648697 322818371 187487686 931847103 401218458 418979998 278675480 843508897 362363604 572067794 373448893 432090413 934161652 324833149 952808075 552605692 718563550 390265989 382459147 593576207 178093660 438032773 48433282 160514796 237342812 776142783 998984529 479757668 890709213 920808178 644818342 699750409 899481425 890505674 127196075 293853199 529514999 371404820 664954783 372692116 256012471 305059686 497821592 471461827 429142461 706766470 369620701 553857129 347868483 41723445 955…
Output: 508271651

Example 3:

Input: 538 838178820 302041079 159272695 3026892 879067315 997569052 911166957 79151226 757651198 815164249 -446836 206436111 592294008 977420132 606500549 939919139 716007186 306989249 612452553 901975165 280051170 218954276 345045448 697716388 336334266 601626178 377029720 700530960 932941731 544317166 621876422 535146528 330744261 936355267 769869436 131672152 89801020 915920571 662824386 241100285 379261210 921407534 963017004 996609848 395047631 654124422 414800445 397221350 612423239 883707794 756538575 327303601 419993144 335789050 944844550 890381723 494308136 670102718 55723972 256402169 654764957 90686097 929850610 973910942 44560768 777653527 4179647 261790957 412723390 28400769 46870267 836499447 504390121 631355079 837369952 413988085 182119055 564526618 533906439 735040119 862568080…
Output: 472824665

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The Bronze vials of Brevin - EASY Coding Problem | CodeTikki