CT29188

Ranger's Pair Quest Ledger

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

The harbor bell rings at the honey farms of Buzzwell; Ranger weighs the day's ledgers manifests and starts the calculations. Task: Print YES if two distinct elements sum to exactly k, otherwise NO. Input format: First line: n and k. Second line: n integers. Output format: Print YES or NO. Constraints: 2 <= n <= 6076; 0 <= a[i],k <= 1000.

Example 1:

Input: 769 1073 236 45 372 237 941 449 950 767 474 273 76 958 289 489 273 175 559 88 740 823 76 29 308 786 257 975 847 528 55 834 31 130 461 937 706 970 934 923 843 217 570 794 470 173 913 256 550 460 366 532 145 483 750 874 680 771 939 774 596 904 476 79 464 725 163 957 252 996 191 388 206 847 96 479 973 521 416 817 238 342 432 399 350 294 172 551 893 86 525 747 870 724 240 750 931 603 743 73 980 956 172 672 288 225 953 356 439 313 411 641 409 510 873 834 820 543 352 43 604 435 601 738 552 310 701 997 573 424 372 575 78 871 79 795 865 94 692 343 949 641 534 34 429 184 549 977 64 652 401 714 120 709 231 286 174 203 19 817 140 982 412 389 244 928 600 159 263 137 602 654 557 275 503 999 166 373 694 918 392 765 103 528 462 831 95 954 201 685 769 876 321 517 440 282 247 298 253 17 830 122 175 832 536…
Output: YES

Example 2:

Input: 5569 81 649 245 872 491 13 596 564 442 791 688 25 474 110 409 784 776 495 661 288 330 230 522 770 182 18 724 446 122 297 411 807 926 109 707 999 60 920 952 226 416 350 797 802 922 922 783 682 123 846 0 953 427 691 401 152 151 270 163 410 93 840 210 636 942 430 840 452 443 371 198 725 479 754 734 191 644 461 940 449 123 364 715 29 225 553 149 781 773 577 275 551 543 97 486 462 470 443 640 237 960 665 214 451 636 49 557 172 826 813 365 287 698 137 887 221 368 821 743 136 961 149 718 739 678 44 423 775 727 558 903 750 912 982 70 196 561 502 326 703 270 573 707 850 472 496 746 556 614 398 104 507 561 763 281 86 790 214 668 434 574 774 178 844 165 105 362 571 178 225 336 161 458 386 957 659 379 852 156 266 837 767 137 589 789 897 217 759 971 630 78 704 550 998 442 215 652 491 478 33 4 464 840 4…
Output: YES

Example 3:

Input: 3535 1849 231 543 470 238 566 998 519 938 779 993 326 605 669 817 220 585 321 182 416 487 3 149 595 280 6 864 1000 450 447 993 764 282 186 676 983 920 54 256 679 135 378 358 817 200 67 630 731 471 935 507 105 139 184 91 563 607 645 135 118 951 150 246 2 680 758 705 237 242 173 536 775 371 640 752 749 63 615 13 563 406 874 656 56 582 268 632 962 343 167 841 800 410 834 738 256 27 476 276 652 854 15 581 977 77 982 853 497 653 859 773 785 755 422 154 506 168 228 597 485 441 877 664 225 27 142 485 503 732 214 748 697 870 583 943 595 899 985 27 729 867 921 58 91 218 386 298 804 169 4 768 526 998 662 27 646 820 549 922 586 260 736 557 123 12 261 50 748 7 664 970 239 957 416 137 219 634 544 913 525 108 883 826 199 781 607 398 737 511 412 797 25 835 913 23 689 585 536 96 692 904 28 570 699 295 198…
Output: YES

Constraints:

2 <= n <= 6076; 0 <= a[i],k <= 1000.

Loading...
Test Cases:No test cases
No test cases available.
Ranger's Pair Quest Ledger - MEDIUM Coding Problem | CodeTikki