CT32749

The Pair Quest of Frostgate

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

Deep in the northern keep of Frostgate, Aria studies rows of registers 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 <= 5047; -1000000 <= a[i],k <= 1000000000.

Example 1:

Input: 868 308757549 856325433 931324902 679128621 778340049 64996453 908838207 487077658 103440609 239369120 926224933 468258474 232847884 648174513 699002280 193813183 710718110 144533050 160994961 620014236 843542114 273378938 426568466 61176 861894463 986184221 66967840 966625114 154385612 842121667 511684549 934750412 857954205 262827372 100896964 953791392 904283787 616857321 719689770 135750032 288975253 180503253 737455397 111770716 697032858 124316170 336627112 119091005 424825348 510456398 938415303 175293038 332308870 661510350 552610961 847730382 416148959 199199246 939758504 187324903 921551448 172005962 946548853 172741886 622082044 972594317 128258154 485634763 952686468 620483003 770078804 396535002 261462389 821271019 368851784 368034247 548582565 113073692 88005781 91135259 6507…
Output: NO

Example 2:

Input: 2746 739150476 132618440 352580688 235050150 820350765 230563064 525683714 564706938 940901032 311961554 792096289 482650012 187193299 588667179 930731723 41744749 518327933 981306883 457357322 644051481 519537606 294310932 99920100 487301345 16481634 264104146 830673457 761469774 57616157 366172050 404207558 865063815 882712039 464860669 12629037 361905080 308139651 564904672 620671511 245875420 850839235 709463083 283349618 167994978 993676626 135123745 246283550 597071651 516271724 820772962 240737153 416534670 581746006 462756308 10471542 207379317 160736316 628199279 782971712 71338814 733815437 296912545 850943299 835354499 329279683 920430703 867711822 141793270 283960499 69419288 878166626 920760054 46446947 444923751 311674424 132556510 332588419 284654523 323596808 554796684 2113…
Output: NO

Example 3:

Input: 1274 1222818154 347828909 460561530 405216654 517611546 933117994 155327753 603773698 378425704 482652228 139285656 450367960 531314322 916804288 33045895 577091719 982029865 945310745 524436698 678421823 260932266 965630031 883281410 503076435 882495167 839320563 318586438 861007189 517865396 848612628 499388215 150021817 233446827 859037886 142052532 676607910 594797148 231151072 927273048 530765895 74290475 874869158 934185313 222901147 582814953 517826038 804901304 937077705 650090264 91608270 947421805 637655913 207863713 10108899 717047144 711926794 869076033 817145057 417770887 360767363 801871284 197981796 874418594 252804472 943790637 192696685 37857927 832282802 204407003 871391864 45317108 787093824 686007930 245710691 527325669 917063638 361148434 11814915 922547743 383659590 8…
Output: NO

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The Pair Quest of Frostgate - MEDIUM Coding Problem | CodeTikki