CT24234

The Gleaming Middle Mark

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Caravans arrive at the frontier camp of Duskwood with crates of registers, and Maya the archivist must account for every last one. 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 <= 568; 0 <= a[i],x <= 1000000.

Example 1:

Input: 404 242670 315669 949986 164959 431416 307540 247222 50302 313287 172110 560188 901185 172016 869653 880912 956070 301281 452822 329596 269336 494779 109483 275494 699719 499960 232257 64055 368708 373677 109051 976746 898423 880785 953329 225796 893186 443394 11104 714920 228410 240586 287418 320775 809368 60722 396652 127409 458545 829784 163199 514453 319915 574188 603336 849189 505309 187904 90834 166342 248585 470602 732858 282379 991152 440202 169861 987273 826381 878294 678192 457121 888049 949373 754886 820259 54301 718080 509422 229096 686553 309691 946010 489732 221692 546403 357693 69390 914497 558703 378869 158198 66200 750573 334717 13426 480744 884090 612408 424986 9482 982172 433656 205351 367345 622395 809666 738001 234758 190232 292730 216972 475784 733763 329491 177753 80…
Output: 494779

Example 2:

Input: 240 165626 35592 226665 547594 673016 438100 340807 344934 164181 376972 840467 262406 916519 570443 921815 104388 402347 400982 408838 898560 959609 157442 484438 53178 772811 809520 855303 888997 185659 157675 495621 619064 71467 505891 483660 259023 310200 295312 807038 452889 599330 894901 563568 202329 403143 855100 892124 617801 779227 592941 585261 652302 135218 571223 346276 300224 841521 19294 396814 237066 735834 571723 56078 838232 531695 857804 674930 6199 525342 320535 868110 662540 732925 86505 396522 763476 267490 328843 863239 794832 498604 352335 721718 204241 401512 775096 213791 569785 824197 719992 41462 459432 157368 693078 21116 749822 989530 835507 450504 867337 69174 793462 263728 298653 289788 717521 800651 464442 921807 26138 961296 374324 881994 327703 88233 9522…
Output: 483660

Example 3:

Input: 145 222500 321675 869661 681252 934469 942168 601536 730173 509042 541796 360256 575779 418 602907 165095 242557 4774 966155 313047 929723 131859 66709 146055 650148 208743 401950 440092 957582 690675 880989 916604 695489 683817 52261 546155 574521 116130 643105 179745 602821 943437 571482 860392 237026 383705 174573 519138 544242 339801 540738 926795 428024 191868 366476 817984 459356 627730 626454 249358 87508 979906 79885 789643 108051 149328 883733 537824 359491 790066 786179 459286 95720 732123 165530 500738 80593 632408 471938 763991 42348 312775 442736 509869 622254 836489 966089 559863 619522 655421 724831 288972 547869 977835 349747 944872 519034 680231 912254 753996 158211 956631 935498 712850 848497 364312 883564 988859 87161 814974 773884 903589 869578 523547 397181 628104 2878…
Output: 571482

Constraints:

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

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