CT27613

Wynne's Ashen Ledger

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

In the garden city of Petalbrook, Wynne the assayer keeps careful count of the vials. Tally the donation drive, every figure matters. 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 <= 991; -1000000000 <= a[i],k <= 1000000.

Example 1:

Input: 415 -652160650 -105793244 -9329163 -686478390 -261934276 -213068139 -726295355 -422509130 -614859605 -422224633 -491689002 -686088975 -23370515 -525825652 -504665231 -290199806 -908677305 -829900320 -792459445 -785369792 -228853048 -346515310 -78949942 -32050147 -272827438 -751593350 -766846883 -932270702 -694809932 -400738005 -216934883 -283408168 -150490327 -555412968 -771261728 -291964489 -860744492 -961584357 -537106870 -669134616 -609041034 -39041353 -979955543 -467597055 -498885286 -28975141 -883994050 -601823704 -729776918 -962771790 -335022327 -371654233 -986514798 -286014008 -931286589 -203653364 -117676998 -979929990 -829677892 -829035622 -281163566 -704101525 -95761298 -293390326 -851541179 -981519285 -969860462 -854793730 -53690842 -191629564 -645293427 -101330382 -598989047 -8…
Output: YES

Example 2:

Input: 242 -852609278 -127437030 -251915419 -664094510 -832876522 -161510384 -634334046 -133510795 -676090308 -300202861 -874247809 -530604754 -486001702 -400300823 -91384103 -490434451 -136527766 -761679027 -593858232 -189392783 -630401668 -411531527 -848015083 -117957341 -683178067 -957009030 -266585743 -51450798 -545236573 -543282704 -173150302 -184166164 -858034690 -756553142 -171308438 -734878854 -747179359 -157677457 -260868450 -605707547 -319895928 -774844481 -349744519 -479088085 -157594757 -435765606 -311269274 -766721470 -586122656 -202597512 -908677279 -448266704 -662836228 -111898257 -750907436 -949978896 -803640785 -313551231 -221226125 -319865454 -7115646 -216371389 -238747384 -605900345 -135256024 -484171267 -508663024 -911710214 -70972790 -630466037 -207565723 -266615340 -19640470…
Output: NO

Example 3:

Input: 201 -299680829 -714734771 -850407556 -527308753 -370212643 -906729126 -782550425 -457455475 -324125060 -189189988 -600913149 -416141572 -400846047 -251209479 -594855556 -872422889 -607895556 -214898874 -450167305 -177169326 -542657806 -186000138 -93281825 -313414697 -715568978 -784550966 -316453752 -493629339 -5726622 -732751437 -568558429 -635136757 -237335254 -321100782 -129748499 -39399187 -317963191 -134269943 -665887461 -929973960 -739239979 -404854267 -599038262 -417094155 -376513182 -95914125 -507231180 -604957497 -574953953 -382416280 -84101892 -493276270 -554372159 -250840594 -813176868 -568188749 -284376652 -129688881 -720448812 -464747529 -977533991 -769384034 -44389836 -444592005 -181638804 -975533816 -207654116 -789111066 -742414098 -533225289 -941529918 -882126231 -836430784 …
Output: NO

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Wynne's Ashen Ledger - EASY Coding Problem | CodeTikki