CT26814

The readings Distinct Count Puzzle

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Every season at the island market of Coralcove, someone must win the guild's seasonal contest. This year the task falls to Quinn, armed only with the readings register. 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 <= 742; 0 <= a[i] <= 1000000000; answers fit a signed 64-bit integer.

Example 1:

Input: 183 310950323 604795484 736432009 687175428 981950368 827819940 18854684 422843670 215893611 357646592 29678618 488674467 416524515 451492966 525940918 540042443 899077845 693928081 210633031 327537025 837546343 133811126 993683790 177507946 139398835 961827263 834858730 781490742 232858038 951421356 580325904 203971522 564857703 528026746 383627091 436008332 398572488 405388962 885559986 36867401 823205069 850902979 487270972 105076048 484521909 563974597 558519016 293648130 627206473 752991501 847570557 773436578 671605896 545966066 849797466 913741 389088122 990850540 290090668 399325453 11307703 459078052 471696912 323678425 369387004 67643692 936819083 660901778 552139496 536395788 478478121 70711338 285588587 11255015 823290380 426949079 210585767 901313632 245502474 942650061 351493…
Output: 183

Example 2:

Input: 71 904544547 839803348 52450079 196239639 481989808 976146322 984105679 760186418 536616708 938338521 233688678 261671695 311466137 301206902 674328475 783337199 227536785 644339220 583577384 924404138 451300552 852602239 898263869 514469888 226940814 320382524 615086706 477694021 342836705 737637699 20211257 962880986 336432450 718485288 831231388 143987015 618989226 301655608 327244834 23093270 82733261 314921660 978908103 13181870 737276709 530100904 672358971 921638262 298449129 368849258 338745103 19092350 983273122 928567828 40563518 671747102 840116589 668366542 652131085 334838456 756114376 340379249 964292715 519476010 142859720 243289820 23052240 351444249 121894088 431742367 562318124
Output: 71

Example 3:

Input: 287 160958585 992649579 217552989 43244537 170487183 190370742 123943861 64891795 522660283 524396990 264878959 702431093 896211157 458734550 396469398 358204832 736594011 774685217 434506793 61770860 176242929 956117387 178126425 270349205 448381957 153089445 354835748 908508290 900207508 261146305 460797062 525081878 448548324 520252478 889860944 977268148 607467145 678838426 302253458 543301148 337369414 426285663 568428791 146123011 219118245 756247683 884126994 932421592 692348673 692761022 959318643 720583851 996159855 504102965 721431087 52981897 441064679 344311000 340701740 579315150 407615268 782828932 59162209 264824324 17377965 943548519 626552916 76481994 412127014 660404589 813626585 39724780 880969694 630164967 80513118 347040016 636583295 823060573 922807341 484294438 53226…
Output: 287

Constraints:

1 <= n <= 742; 0 <= a[i] <= 1000000000; answers fit a signed 64-bit integer.

Loading...
Test Cases:No test cases
No test cases available.