CT22906

Kabir's shelves K-th Mark

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Morning light hits the marble forum of Argentium as Kabir unrolls the day's manifest of shelves. The tally will decide the next shipment. Task: Print the k-th smallest element (1-based; duplicates count separately). Input format: First line: n and k. Second line: n integers. Output format: Print the k-th smallest value. Constraints: 1 <= k <= n <= 276; 0 <= a[i] <= 1000000000.

Example 1:

Input: 148 127 966341424 80617785 83849264 809958775 101317821 430258015 976266844 996878553 594337275 719742059 435672035 420031137 200174783 59624114 241062553 80500231 204685580 170575373 30004723 927349000 165114117 42075092 958945351 367470249 295757485 681642995 277504234 239370786 765857599 457182893 277162925 296266148 689990596 705385320 791937285 239329112 356267823 491188308 758669881 42739963 486707186 697051 238589977 16565356 453659782 182940710 550916152 575190412 77744369 971113191 859301528 429078059 677120084 439937679 806857246 816132328 962954274 482971972 465532364 515678861 487534374 412174955 317124322 464571610 542068439 230531890 148780584 121044229 871085097 954266746 324881780 996174289 350909819 982925173 339367878 517522330 546656586 825428060 530058751 456054965 2795…
Output: 871085097

Example 2:

Input: 265 80 337228007 745821430 627455020 848895741 121746401 110255987 457945397 404359622 469943578 689695497 244401827 293533470 177543996 871140631 789154944 100737616 633116281 595983763 142560767 404342494 363365802 730275895 278811442 557065641 77372897 953368869 620641216 602322005 342450719 620273303 952944111 308451663 894124423 418510362 54203620 829958974 473641671 77506901 796617046 963707466 61993895 592705685 148933021 704771653 533511717 472437250 544490497 547326223 221419942 262326219 620323775 190001611 547039077 36664889 813822564 495601509 821084194 808211632 373190248 316518817 670843268 587446242 662116168 984632517 328909893 720473200 626102038 654553388 27558275 849802162 33079490 608708452 134596359 325562938 878266416 959563753 427301476 106152829 106599457 702083157 …
Output: 258205373

Example 3:

Input: 237 86 827885360 245180674 804140724 463179826 335126954 296190511 974639738 601572807 512200376 44109878 386533861 363829984 528138317 301866471 499475857 664534850 771248313 426498688 860198598 800560620 536869999 149971829 790501571 976084333 407414234 267542389 40716886 163945754 137182707 953803100 406069462 653559491 122120365 43833400 760950450 364799452 527131263 260132072 887523863 502722791 67286932 449430296 371765313 536591115 75809297 216017693 511378163 236470879 919962837 572884299 737645233 647906199 821583475 883522007 983620069 91268936 627670653 442327902 20132541 953921948 491937493 251152061 632704496 394957313 582050366 704617463 616439615 492137706 528726826 999223326 37594876 269783404 645513607 624592384 370366174 148644609 805032772 969957914 294234084 843141149 9…
Output: 404474989

Constraints:

1 <= k <= n <= 276; 0 <= a[i] <= 1000000000.

Loading...
Test Cases:No test cases
No test cases available.
Kabir's shelves K-th Mark - EASY Coding Problem | CodeTikki