CT25415

Cleo's vials Pair Quest

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

The harbor bell rings at the river town of Willowford; Cleo weighs the day's vials 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 <= 355; -1000000000 <= a[i],k <= 1000000000.

Example 1:

Input: 318 -314305012 -75760658 262875733 -668620487 -727393365 -266937502 -286951241 -122777642 -21198764 195879786 -938383110 852413230 -887786524 -781840619 -178938667 -722644389 -977805239 602526197 611638895 775969859 -189256469 -710586605 -397169683 404411769 918195498 -47383537 -262419134 927681775 -386386089 -156006249 243352559 -866288998 -854247279 423877236 32730467 -361106667 215788860 -880710741 -167578774 -972434939 -122814481 -826591385 66909528 -354974098 -398023051 -570900917 311710068 937835913 461424340 289462656 749481424 248233830 -649650307 -348352552 -226961943 26944548 184745723 129817499 -695319232 869409819 -491656414 980221153 -429290870 -707337764 -522767791 -447378672 -876054136 618819285 -348758050 272017057 183773 664289440 -322937216 -230098095 890415020 -125024192…
Output: NO

Example 2:

Input: 214 30262032 -253217154 261355156 560935752 518644602 266881007 -290118629 507419750 428015195 638182015 637946164 156298654 238088489 -33633142 54072147 -909629795 518502457 -351502289 -790685274 -561653054 923830798 443914587 -417218154 79863051 281836762 -918574778 442403922 -86623117 -199760677 -371216380 140859500 894887859 592115012 -880637798 -221924351 -561084968 -445779676 775297255 284841035 -709664037 -10634610 236766401 -330788306 544498536 148641481 -642984487 -442541412 719235091 433049519 -320475535 786859860 -944940251 346184947 -337816164 874692755 -966604369 -242736991 560160690 -729254497 -49598133 348879566 -344146548 -755472035 401689191 -924482687 -951642772 58580078 -537876442 506263226 -535089360 464400114 573785422 -104103016 -646146655 -658559810 341494173 -733435…
Output: YES

Example 3:

Input: 36 463454433 257926290 -971757305 800451599 206783366 -649437796 -548088381 45418216 797306955 632894793 390603708 520892268 -658753486 -913703071 322276762 -299417425 -765624727 784929308 139182943 475838803 -577124483 722696391 -394234879 -849614754 -174314736 -951472019 205936338 538921239 843653467 -886706688 -3953403 -349038297 139427857 836478906 526744895 809076027 -463581641
Output: NO

Constraints:

2 <= n <= 355; -1000000000 <= a[i],k <= 1000000000.

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