CT25186

Wasim Counts the crates

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Deep in the mushroom groves of Fungaldeep, Wasim studies rows of crates entries. One clean number will settle the guild's oldest argument. 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 <= 518; 0 <= a[i],k <= 1000000000.

Example 1:

Input: 497 775463426 155142838 266203054 615364953 798673514 242655296 750477660 602063300 681484016 584803632 548039528 340808265 711963320 222879307 479717085 814095200 187446836 693721695 548275322 924914129 460178062 172183821 438231827 477284790 420709803 37561085 760314621 944654179 100859125 790570289 992188148 347916778 479887234 975291657 871714713 16486925 937658270 968707114 994018400 584185662 44581422 418514011 998105550 967701415 643093551 928243444 485378100 47996522 873927877 392919101 203281487 573538317 309550099 848508188 685210005 848695076 594751050 964596057 672755945 482942048 298732197 379084330 733202482 64169792 9584984 676403202 781959851 626564012 63340708 790645392 444877321 837895151 179340759 490469431 111020920 81922799 77193539 533053423 511078381 561146718 144618…
Output: YES

Example 2:

Input: 443 1312094408 134712929 292426750 363053423 554201096 953298441 988739772 262244866 892775270 732927160 201762831 699079412 30459193 620445286 116347460 388329806 390403151 331547896 834442660 619780559 533073491 234493761 339259451 932513435 999477520 25362197 693357602 889970163 872203126 140764919 45818805 148032675 559512895 684304547 865415951 888084564 928244403 729681171 179313599 383824074 710195479 165702325 983819076 981886836 760249521 807056363 209148536 420031950 776413928 421393959 284804685 64097849 227242030 900400572 561956206 361436912 707771169 959558011 482631579 252102934 797081137 993306900 723272054 461392971 448130814 400935799 212755996 620245720 370068016 194785253 419059054 149179434 591881068 509350482 465854067 221257991 586453225 218635291 189686406 366253573…
Output: YES

Example 3:

Input: 280 1289917690 91306524 946852810 491954166 223174173 246051409 199575767 214817298 577925777 95797815 407832515 751103947 810128597 69842885 219241688 639623894 490469769 460777432 219748014 977898874 297762089 236547597 506691081 643464393 293206504 939015135 598437508 913512849 122555298 871555373 947035746 269880952 378952190 247099634 872172800 562144785 689302476 272987048 158270052 907337369 549372775 672175474 89254921 346545174 365398510 132502039 59904415 902583601 447579237 355986815 336480440 320128932 490220770 820831613 422909494 638491825 256294829 337655747 483013505 801047439 952082917 539646154 360285704 774732158 853177023 211401810 104583721 52163748 554846165 889399899 907364179 429184583 528824651 843424611 908660047 228213234 26261455 585568940 907187254 850337995 42…
Output: YES

Constraints:

2 <= n <= 518; 0 <= a[i],k <= 1000000000.

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