CT29343

Blythe's Pair Quest Ledger

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

Blythe inherited the archive at the acacia flats of Thornveld along with its curious bookkeeping system for shelves. Time to make sense of it. 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 <= 5522; 0 <= a[i],k <= 1000000.

Example 1:

Input: 4999 481265 914226 893678 8978 277338 186175 858514 974671 399390 183569 583030 216693 625118 215964 85884 387543 350861 566326 561034 873326 457328 939996 973071 20937 860725 100994 292941 297374 596801 528445 410469 860107 633732 203438 497213 619537 960054 165793 288224 390662 71166 615912 167485 647598 708392 178693 29102 684765 912893 189085 718137 835304 966636 130284 911857 285964 863249 964142 491392 328766 112532 269208 267782 783799 791698 951183 227684 210410 554371 693961 597403 451610 335856 788827 479053 758732 925313 686827 449127 94400 184725 762009 916071 316832 343403 185493 601011 973333 317662 809889 446013 900137 483732 559903 923368 204729 859905 810196 87062 605996 14885 222691 413063 13769 261480 900679 722182 610322 714931 413489 419442 390160 50429 516677 648316 4…
Output: YES

Example 2:

Input: 1293 1576752 697325 173643 947258 246490 55961 594215 50031 918908 29663 844719 684070 102971 926762 288511 639933 497046 646211 895958 865094 666909 740602 142429 239275 117975 357604 436436 785508 925975 408306 415791 986301 843026 746782 824610 927121 874941 2474 517148 691417 827696 224410 59506 231364 493735 710210 588873 679854 442169 539649 252918 681774 53360 237898 855653 207932 994438 922147 91742 560003 456875 798375 631466 598158 824575 543554 573339 375446 541508 692026 573605 545140 343252 913044 290317 815977 509661 382345 434122 382112 403614 276377 957941 360024 158887 400789 895251 333241 832777 679030 519094 911144 98232 463508 551712 218253 96553 43751 660948 495702 115894 693225 254872 150973 573405 184788 321890 751498 603447 342225 843156 377232 554367 682774 314903 …
Output: YES

Example 3:

Input: 1457 109477 301440 196075 506634 590001 721977 400488 831262 757708 190773 227916 713885 723347 755781 242119 911244 967306 877144 51769 809176 937038 246789 765686 852410 720147 872071 498802 553239 651377 883637 192996 182824 982201 281580 307746 353040 722175 435298 948523 389812 177721 822134 776208 651959 72774 294888 797697 982007 112550 809434 989540 627752 180417 561411 67020 285493 516082 538309 999510 866021 991150 214968 872299 276617 864851 833139 184628 391440 805953 114478 341824 608210 274517 941597 970950 610918 149423 178906 622237 220033 361073 252742 922375 196782 760960 633453 665172 691969 72741 833071 968653 107954 733036 278836 548277 649256 422112 653651 154697 832175 156840 133902 991256 245888 899364 646000 778295 231903 398751 710222 772274 187080 525258 573838 7…
Output: YES

Constraints:

2 <= n <= 5522; 0 <= a[i],k <= 1000000.

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