CT25418

The Distinct Count Beneath Barking Cove

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Legend says the vault under the seal rocks of Barking Cove opens only for a perfect tally of crates. Sage means to find out. Task: Read n integers and print the number of distinct values. Input format: First line: n. Second line: n space-separated integers. Output format: Print the count of distinct values. Constraints: 1 <= n <= 903; -1000000 <= a[i] <= 1000000; answers fit a signed 64-bit integer.

Example 1:

Input: 886 -899143 566369 974038 -918127 -932556 -854609 -565827 -748058 -631634 -542011 100862 195971 -314660 222979 445440 -650162 692171 -466408 -614595 800283 297939 431408 -815387 304151 824047 751630 -433710 -488086 -711689 -573619 -313154 724174 341982 329611 448482 107496 -118651 -754350 828350 -895881 -69046 -15879 575044 -840633 -855513 474056 872487 654964 -867904 679587 -52217 751783 -312803 770294 214913 -455285 -484479 -753477 106375 651801 -458147 -215921 -849481 343305 56141 -73997 549017 877391 651691 -667286 477437 -505163 319479 984882 32552 -680551 815777 -448042 861207 902894 -114362 94590 427252 -754002 597951 841619 -174495 -782587 -680696 -704535 184747 -838631 959289 987707 965432 -73810 783148 906274 822750 47184 110197 -855516 909662 -539423 526348 -885892 316464 -20751…
Output: 886

Example 2:

Input: 818 -232154 -183982 -543004 -399947 544409 328440 602740 -213903 857238 975670 301363 889265 611825 -505787 381682 988047 -253969 -527483 -950181 -775306 842920 -602202 458292 -258192 650051 -715727 -735177 979412 -79883 795733 78929 -985647 -913633 458034 288106 815756 235651 582044 -207822 918818 366972 -851494 463181 865775 123976 -833667 -874905 249965 -165640 -62204 -467619 -716833 438116 678948 405780 -209498 910756 -765395 -568464 939890 -840051 374773 730219 -317489 20390 -476725 93024 554885 537056 -972131 -952207 -130314 -677262 -957843 806062 393866 -841744 322532 -93176 -431390 313651 -274876 238715 400133 -32765 -677528 427773 705514 -437367 35906 -908156 476465 592791 -795647 622086 90999 581946 -270516 883435 38105 585531 406449 -628916 286392 603610 -31969 -391496 310984 71…
Output: 818

Example 3:

Input: 583 -206168 -114151 -751870 844243 902888 -805742 -872787 141406 -81640 -220119 861551 838313 -125224 -544352 581124 -818800 20596 -812788 169625 -901825 -785568 -465411 212250 123196 -715322 -580090 -93067 -847270 -178609 747452 901466 179477 361174 104755 579177 195375 -171485 836311 746621 -87229 -402499 -943119 332610 881250 138523 658846 -266909 -623703 -303659 -439161 -17793 748259 -184088 401108 921357 -547070 747520 639192 825109 -17244 -315331 -700551 41487 -745403 567681 729620 165340 -126852 -406163 -257937 -891149 -107864 834775 405069 867254 976464 -240951 271398 472069 -733767 365236 226030 -216992 -849049 -298246 -287590 575198 758959 189272 -824296 -706043 810828 -9246 -685247 -232805 673158 321351 -709880 38581 898078 -201185 -769010 903532 664541 -860597 707250 -935948 -2…
Output: 583

Constraints:

1 <= n <= 903; -1000000 <= a[i] <= 1000000; answers fit a signed 64-bit integer.

Loading...
Test Cases:No test cases
No test cases available.
The Distinct Count Beneath Barking Cove - EASY Coding Problem | CodeTikki