CT23859

Gail's shelves Reckoning

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

It is audit day at the orchid house of Bloomglass. Gail spreads the shelves records across the table and picks up a sharp pencil. 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 <= 661; 0 <= a[i],k <= 1000000.

Example 1:

Input: 439 884968 24287 244598 303050 633493 217052 243404 255058 340118 183892 146727 844421 502817 901567 93899 544830 938835 680016 334416 201475 394906 373649 310492 139569 527574 58180 794484 245059 360005 975267 535454 999138 48146 855700 218750 541729 662726 834785 621227 784765 7648 354617 857032 331723 473241 301567 62096 350487 267906 150768 517263 263211 757682 502715 457228 497637 142100 936040 878693 356466 735087 855268 239315 883273 875439 49933 251183 771366 648032 252311 393423 594545 398860 13902 62095 808909 179776 577103 760227 603929 659832 869759 146573 530083 848223 857921 558889 427394 983688 207037 825937 769594 826627 174018 414819 289858 978968 376681 627667 524892 875136 725835 814068 698318 98714 496257 141758 488287 24378 649562 825739 693874 641736 955730 882709 266…
Output: NO

Example 2:

Input: 417 816821 118846 153622 494813 399590 506328 332901 510752 281563 1152 850086 884059 347072 807641 870454 12168 87904 300572 116093 677572 262028 163443 111267 243887 430214 532428 809117 931410 68996 698497 78620 200846 855148 79971 459480 762383 928205 10080 647456 50843 529477 825636 189638 825504 312834 222637 78989 848966 902623 618908 636796 644557 435085 637107 89987 410326 200695 439658 665477 130158 251536 404992 20326 260939 364390 195846 920461 424410 874135 394280 356020 266694 633706 939108 774984 557458 641066 84157 420261 94420 231615 133150 172308 518480 911028 165071 432413 689136 361525 439963 527602 58375 216269 167688 719904 641778 43258 711622 785174 702397 455284 65212 787328 614581 41276 377755 711297 653812 100723 249067 998060 702241 592119 236265 9730 74531 51956…
Output: YES

Example 3:

Input: 562 1048357 302438 630253 402199 476953 618314 11379 946248 103925 3427 274924 28899 626232 872615 883235 787117 862548 97718 235727 831821 513014 461409 538521 303687 90540 722836 351659 963151 668443 761792 962230 192156 105008 847778 778326 585682 516605 706974 24860 475800 698188 903475 301454 372581 861062 799303 916823 722126 76709 652283 826435 283188 894700 269061 341017 731209 646677 516432 966382 773330 960596 902206 3452 522634 638353 78834 625867 97631 525119 153321 682674 817901 44190 878853 705353 105347 881663 448449 365421 592255 101466 587163 532306 338676 150710 335498 351912 453315 217029 66948 526510 836340 778104 480363 601880 550225 875533 83000 510047 186452 933793 712999 809246 978229 993424 83976 350774 821788 170968 773499 81681 880831 352068 285101 19330 651733 3…
Output: YES

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Gail's shelves Reckoning - EASY Coding Problem | CodeTikki