CT23698

Omkar's readings Distinct Count

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

The store warden Omkar has been asked to compute the guild dues owed. On the desk lies a long table of readings readings. 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 <= 831; -1000000 <= a[i] <= 1000000000; answers fit a signed 64-bit integer.

Example 1:

Input: 223 71606959 990748144 501385920 288772518 261274969 763021547 654455671 369319490 221534392 210451485 314263817 693248091 53111736 555111168 85771616 757413367 518908359 665574726 501909072 221806191 892905452 271006448 14589040 738564905 164981633 793499998 434079024 782604208 310674002 811056853 65188691 372718217 533657860 869975122 914326178 252359164 58691054 13965020 681256364 147962012 355684557 133234167 32242104 223362041 306864990 617442261 745249070 187463504 653653151 157919784 558998597 236840063 837834657 384878279 301909781 899950295 69846100 784125662 116448696 708155797 220903834 974204609 766981117 444443012 650478698 115300487 169306601 390310644 552254578 836149110 256167918 351924358 44754161 174296354 833790282 721214808 573113585 98000257 59804074 688771155 43183059…
Output: 223

Example 2:

Input: 678 130019833 434147545 663382376 759707079 220919983 601498545 96147104 115416534 859294248 892469372 173329003 688714504 337093097 369179115 729206349 338235268 293741592 652866390 479461003 752808988 777468409 591172807 867236363 783734423 640157503 763644682 804322043 591161474 713198763 685125530 654081039 72557783 428079289 270320519 166804282 199820503 128694762 708305573 382398175 487250279 56481664 227625827 269478750 833777783 590088124 266185447 695006038 799802916 839513754 85705589 721354390 597524675 735385732 430270564 53100876 299639175 889657273 272118815 130697580 330837169 872307938 982946642 905652173 706873082 736434194 299955709 53781425 588308609 46244115 656616433 639767074 859121564 789354360 618712714 823339879 362893270 983441279 136760913 559734550 469324380 819…
Output: 678

Example 3:

Input: 574 259048545 410627012 439541189 686532991 279306786 381834686 677730851 337356955 237246204 103918858 476859638 699575676 128274503 334759052 63110084 639747001 774476837 130979276 358997777 300871359 900591860 329361862 144365831 176862716 172258674 85010532 608948210 387953196 3860061 24343617 810687630 784680696 880580722 165628127 430544823 683037372 528005998 595529210 586637260 441361505 393221672 525251147 656405756 187246741 504332172 647835560 925508479 170085971 214513117 444134816 212188643 72791182 166932812 89901502 2368889 485584279 173167455 210595131 236049840 212779725 420735290 65756528 95416571 271953180 42271232 258960587 943093850 1514886 427702238 379104224 835221033 172125482 990192801 493385424 234629703 428948985 928240687 762916092 570473652 971317231 558397702 …
Output: 574

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Omkar's readings Distinct Count - EASY Coding Problem | CodeTikki