CT25697

Finn Counts the weights

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

The harbor bell rings at the salt flats of Palemere; Finn weighs the day's weights 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 <= 378; 0 <= a[i],k <= 1000.

Example 1:

Input: 226 762 278 467 515 668 504 816 720 518 695 740 273 75 29 829 806 372 700 262 822 987 781 454 833 865 416 393 704 743 380 678 637 733 475 881 68 63 955 930 90 672 1000 666 773 426 183 779 339 164 158 494 965 923 735 655 531 231 201 659 765 23 2 572 307 639 476 590 59 963 954 807 637 538 283 905 640 474 216 957 892 215 660 693 731 715 235 77 381 539 624 275 374 652 530 114 396 220 548 886 797 971 468 435 374 523 394 632 220 300 699 414 559 660 874 180 645 521 339 389 432 576 508 340 501 796 841 114 443 278 289 257 777 542 957 715 673 554 65 888 893 341 363 352 783 578 62 834 532 245 776 906 84 460 791 372 616 226 532 171 830 779 664 37 925 818 224 881 490 619 472 262 78 183 726 562 122 695 481 630 119 300 409 864 294 989 531 375 524 187 696 771 508 940 59 335 320 458 75 677 136 714 337 767 …
Output: YES

Example 2:

Input: 288 1431 134 310 454 457 589 8 157 338 908 89 449 959 754 373 928 620 73 404 513 744 13 284 311 808 273 608 411 247 558 894 183 420 89 956 708 898 820 175 199 159 191 99 334 28 171 908 737 470 670 991 22 98 732 963 778 100 56 203 976 276 596 151 192 480 124 645 648 456 625 567 793 168 553 950 456 234 463 445 442 199 840 621 766 599 89 654 265 385 466 596 958 969 614 92 842 725 387 77 591 702 97 749 944 623 287 158 609 228 1 683 814 18 503 892 321 280 529 464 289 125 730 644 485 579 78 264 950 352 197 827 8 643 102 353 588 944 872 995 670 648 509 62 938 219 269 598 591 705 633 284 557 906 104 312 513 844 374 327 46 580 333 498 74 867 160 115 246 280 737 914 42 723 706 575 52 83 627 123 607 216 533 101 902 275 437 695 553 247 782 996 846 434 1000 210 984 801 963 388 703 584 211 331 56 502 28…
Output: YES

Example 3:

Input: 91 65 850 478 491 530 899 214 851 766 489 444 144 174 429 124 639 606 299 378 509 993 771 711 412 191 735 154 123 692 481 548 206 281 869 821 966 903 649 427 407 590 192 408 390 86 341 899 164 283 702 259 314 757 650 140 128 92 559 349 414 238 997 127 467 975 328 712 889 999 730 518 432 135 175 127 617 451 186 567 560 673 94 570 917 290 298 419 194 428 97 176 780
Output: NO

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Finn Counts the weights - EASY Coding Problem | CodeTikki