CT27943

Rune and the Prismatic ledgers

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

At the coral atoll of Pearldeep, Rune records each ledgers in a worn leather ledger. The guild wants answers, not guesses. 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 <= 281; 0 <= a[i] <= 1000.

Example 1:

Input: 76 51 615 650 792 135 994 798 970 750 475 653 207 262 544 588 827 561 446 298 3 686 539 739 40 505 966 356 76 209 111 819 482 485 345 343 357 559 740 228 930 571 378 796 252 650 754 622 191 96 510 780 667 289 68 502 978 495 317 4 773 119 568 877 718 185 648 748 515 823 630 203 525 965 466 732 349 94
Output: 650

Example 2:

Input: 134 48 394 890 603 29 433 262 863 557 523 939 668 730 516 463 718 891 920 446 58 425 733 692 354 621 77 340 20 772 664 728 428 28 774 612 931 910 612 891 404 268 573 631 206 637 305 83 497 928 314 911 760 843 702 146 177 930 98 699 45 186 892 230 86 492 470 167 886 797 621 929 365 955 708 837 964 941 749 397 572 3 635 345 338 449 581 790 350 872 494 508 63 521 290 517 981 231 101 244 634 279 883 532 168 928 888 160 577 826 443 282 81 6 674 133 475 147 693 227 749 23 707 741 533 109 678 224 478 572 350 786 726 36 861 861
Output: 404

Example 3:

Input: 215 62 904 887 143 488 2 285 1 902 836 61 355 503 758 49 65 981 269 890 263 162 581 109 830 804 757 834 713 388 904 986 428 250 331 0 59 938 341 890 126 888 820 230 372 705 325 109 566 588 819 602 117 80 276 889 260 5 398 711 881 789 117 987 774 583 899 522 339 164 138 925 417 91 189 299 750 851 612 970 311 662 328 269 947 379 132 2 399 203 672 404 382 281 911 995 957 245 751 706 67 400 961 993 364 923 970 769 526 156 526 329 866 740 9 606 352 59 575 285 95 174 172 641 66 351 292 625 525 538 758 83 455 68 564 586 581 536 719 687 143 814 439 312 836 884 390 939 27 55 351 143 467 960 481 526 169 798 631 241 324 881 271 621 117 886 719 321 812 536 196 16 866 585 877 128 508 2 800 786 190 600 223 86 179 167 695 36 913 984 198 470 560 23 164 766 266 621 227 532 367 748 360 538 207 718 588 489 1…
Output: 263

Constraints:

1 <= k <= n <= 281; 0 <= a[i] <= 1000.

Loading...
Test Cases:No test cases
No test cases available.
Rune and the Prismatic ledgers - EASY Coding Problem | CodeTikki