CT28024

Bhavi's Tempest Ledger

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Bhavi inherited the tannery at the orchid house of Bloomglass along with its curious bookkeeping system for ledgers. Time to make sense of it. 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 <= 403; 0 <= a[i],k <= 1000000000.

Example 1:

Input: 95 1168668401 830085812 596788197 938585535 251365428 243046124 908904807 631972130 401963105 286012633 364908013 591418300 247019383 311587126 124562656 941116017 360184651 840587333 506242801 976641349 782425617 106493039 702067638 573351106 164512144 273398155 930716673 451834908 914017342 118463131 188954053 682555155 366871725 767200195 673809740 147873870 6735006 180593934 968939164 652362171 971611287 11950741 233817967 786818078 30797823 378532475 83367532 589963376 713426579 223701720 734714847 13607747 80139009 355953416 939271732 213898990 33225445 717872310 98494294 862055029 328939864 318208605 419786409 505259878 552370972 425442417 429563790 866367430 202116095 628205324 337931295 48823352 37455708 336391901 524630475 904947874 252747106 639532274 536651103 482921871 4228331…
Output: NO

Example 2:

Input: 266 1085243862 539680846 863653419 971383036 623825777 687456339 851422965 779896805 845458799 871582728 929021115 98610643 320514181 314311573 969558224 482306430 224650093 2485483 316841645 322127426 944394875 510087890 381489107 643592962 314345886 404268887 510391051 311715696 367510595 466396887 202696664 436424440 364032304 843852384 699368114 52962629 178926138 462261950 168183438 33194565 478530264 835625832 237953863 542593500 773809383 952050575 654063018 503095754 374595553 53402943 301015191 816453922 106736297 170656416 31263666 132685901 852229572 953275670 972696039 679282534 769675403 739828569 566376003 745816233 938322047 448525832 84068832 10777468 556660350 561976875 445364897 110316817 865711764 470932555 752943566 160725169 753174059 75540481 573321859 302746861 28046…
Output: YES

Example 3:

Input: 29 1264736075 470537770 568794975 685541560 265529910 555209234 956208992 641589499 627861801 7523682 410458569 337031472 760253615 617303864 969263217 727527955 226219043 228129608 961877455 465881716 213890576 157484783 910295026 519065572 585058557 88923209 563475089 556665410 584703435 786798599
Output: NO

Constraints:

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

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