CT32552

Quill and the Pair Quest

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

At the beacon hill of Lantern Tor, Quill records each vials in a worn leather ledger. The guild wants answers, not guesses. 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 <= 6881; 0 <= a[i],k <= 1000000.

Example 1:

Input: 2834 852806 120512 641259 871936 475314 269707 906543 271447 493279 407765 597830 411088 711535 249920 556791 365882 2038 256857 921920 897888 642833 376020 708722 772453 771610 175952 398565 712817 356827 827693 227658 895064 426040 452547 987405 975884 252356 762998 28642 1598 682432 901090 196277 29466 531270 106837 275931 332899 708466 649188 92166 920472 577650 847461 526657 14649 451676 46559 371376 273920 479772 368315 989675 522473 788075 509638 140168 696958 151950 515640 568205 359839 268644 773148 442174 824732 428120 361087 209852 862367 602670 605686 802283 713092 769768 667064 562003 753770 974313 957942 430540 37631 689340 421064 17328 933166 261430 135070 477787 75366 895606 394128 127503 868908 874577 423428 696429 859318 636215 987636 46142 150507 756151 744597 99364 4053…
Output: YES

Example 2:

Input: 3990 1525154 644705 211089 425098 455295 473205 483852 575112 799685 822195 183084 751572 367606 875829 992927 744246 373988 893628 860820 396372 196639 702718 367365 160066 671581 650544 40455 35285 427183 966353 566499 208845 107832 490971 335037 484050 879481 452570 855322 453837 269062 123913 604291 861951 461569 731703 206977 202365 638694 195086 473975 993599 471522 677913 462998 593286 136371 393338 806722 302695 586992 836320 593942 86125 257881 809267 982229 169450 876916 802022 710153 217010 797764 443342 46093 862295 14185 13259 475201 483675 687644 596491 904368 624345 200105 50820 457285 778803 647165 573549 121420 245451 522976 420661 617369 51667 106000 399327 697396 973936 181589 195345 190524 833122 791218 613469 396368 734643 486217 62686 63495 350644 100817 387252 210612…
Output: YES

Example 3:

Input: 1323 1144894 133592 776548 519799 41742 237504 589659 815339 82992 229206 933868 308291 990157 871353 241526 924026 259881 876808 458561 179554 761323 811727 660470 871045 512033 622618 760308 122032 957915 410600 316674 960010 817871 297799 194765 274156 209778 671508 111119 329084 823159 692748 706669 961059 727853 202657 45963 463087 615826 821036 608872 236220 381024 112673 362061 514917 153265 905146 708610 518320 38630 853578 978188 195424 633900 358303 978309 876985 225672 853426 594108 740889 145284 33935 377523 407875 951515 731568 96358 486112 808601 781128 683318 20039 58872 943716 98285 977762 66062 777771 441251 172051 996845 21393 269342 744947 367950 110536 153011 660560 618195 815878 568750 133815 532824 577714 539631 512199 695047 198788 137332 174449 617719 852199 92943 8…
Output: YES

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.