CT28622

Aria's Pair Quest Ledger

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

It is audit day at the fjord village of Deepwater. Aria spreads the vials 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 <= 307; -1000000000 <= a[i],k <= 1000000000.

Example 1:

Input: 5 -483384221 778796025 -64972207 -684586798 -288240431 -160563629
Output: NO

Example 2:

Input: 109 1009806919 188036064 625701042 344067486 -14732177 564150814 -813316740 -722363713 163614652 464453681 -589083196 -998254947 111711597 -848706397 -212581291 -241122321 -734365909 -104027415 -559295684 -212089578 -496286145 -244525307 -989033572 597149165 -930577427 429660189 -912536615 -637773399 84349122 844072969 13431784 792983668 -645576996 -647445825 -21874612 254106294 -829359167 -653295122 -646197831 -393359876 852669023 778974353 751883962 -550516795 990970661 158122022 23730034 -980542252 159474508 929105850 449385599 -722800442 -941849832 41716915 -747271740 -815254353 898095322 -391749164 65578516 -612565823 742497196 551353909 -471521129 -271290423 774260906 277213992 878085758 -501665343 -311532152 -665185611 347218427 177594136 -514400665 -862904701 353889061 -72128961 -8…
Output: YES

Example 3:

Input: 273 976516372 131039058 714970274 734869610 -996314561 -888930081 617391428 50692412 509905184 -299165920 -534766708 -976581924 -322646880 257667484 548078608 -711868668 919719018 -723137164 542046865 -99855231 -391704014 -231109154 150913955 -914632946 547701827 735749396 -451917808 33291709 -989106819 -62861657 461815300 795446550 929604592 495167504 880185455 -39483889 53417100 432313173 -288342510 -953514804 -984995000 343007299 453674160 237023459 -950568297 -727613389 -310516064 -691826433 -698232492 296052932 634720052 461272234 106765899 -908453786 483977692 -337296767 662311540 22661665 136455075 438668478 -650827076 975508855 283138708 -314041124 -680244831 807433436 -152319066 106437069 142616329 516281311 501666413 294784593 -114252211 -169131738 663438944 -999586076 137421620 …
Output: NO

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Aria's Pair Quest Ledger - EASY Coding Problem | CodeTikki