CT25152

Parth's Middle Mark Ledger

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Deep in the steppe camp of Horselord Plains, Parth studies rows of crates entries. One clean number will settle the guild's oldest argument. 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 <= 252; 0 <= a[i],x <= 1000000.

Example 1:

Input: 177 953059 710473 502613 600665 733167 149608 661115 316288 922430 788232 839432 555617 322907 172172 514384 223396 869991 401514 648860 97723 274319 852355 867276 600432 547496 980374 541158 326256 776817 316364 433523 326398 821134 246037 562714 516263 174266 87553 383556 468201 192765 566550 818019 651172 670157 551480 568418 746130 887789 907869 928641 652385 581360 387017 33707 240412 443539 215128 104531 303841 805656 782906 444087 234599 872771 405184 616234 735076 740268 692291 635513 322928 398824 916139 239945 448575 940748 101558 80042 812153 545831 782693 408275 216287 943359 847681 74490 987208 805078 232013 977867 587387 910318 843526 914384 564434 806146 513946 107005 212329 714600 518245 587250 959369 715255 814278 361624 846027 626889 324835 518370 732817 485544 210939 427…
Output: 553512

Example 2:

Input: 217 965667 454123 372976 911813 939990 488840 201553 556003 914609 608135 464762 973271 956880 948511 285232 308493 621610 344992 23298 701808 347530 146429 369193 283264 719005 55062 787346 341447 746544 128353 54167 951825 217960 803501 115473 986321 85311 815267 865654 610311 636572 43556 237342 526276 290980 426769 745604 680225 549035 378027 894872 150771 715898 27625 153521 454679 663825 980043 177116 51825 197210 963539 678865 41020 858407 658792 772450 620579 674229 43507 388228 974742 934947 94752 605960 461153 435323 163329 564258 50278 996595 181673 677944 453221 219582 946005 446934 358528 178244 602013 513887 174383 387811 726041 24603 526904 346970 429888 34777 678986 446761 158564 78794 342627 596574 433563 583304 792759 975710 676177 616575 270314 873030 223517 244061 81610…
Output: 470092

Example 3:

Input: 144 870842 275958 157712 593416 399841 279269 644860 159599 371322 431896 781926 597544 735296 599265 283697 62017 408699 456371 292523 254459 345108 714090 83706 395258 711236 753606 797646 105283 813384 725964 193808 17641 517044 859449 587577 240404 125834 140249 477638 280201 443756 444485 659991 911464 890539 375670 704184 312183 658686 344200 578637 724471 632502 539021 114199 582660 229977 314384 815672 469005 416148 66783 958819 636083 878572 790561 300624 214836 304827 36421 485324 313282 613501 896368 883127 337870 611722 238005 19352 602558 222869 999744 791069 243486 235483 798415 743903 435047 691045 770798 471565 951699 731987 707308 146195 846283 142238 455276 725880 364119 948530 280867 563649 154106 676517 438680 953608 254936 907761 960463 519826 567894 109872 566958 6837…
Output: 471401

Constraints:

1 <= n <= 252; 0 <= a[i],x <= 1000000.

Loading...
Test Cases:No test cases
No test cases available.
Parth's Middle Mark Ledger - EASY Coding Problem | CodeTikki