CT27380

Gautam's Twilight scrolls

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

The auditor Gautam has been asked to reconcile two mismatched ledgers. On the desk lies a long table of scrolls 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 <= 999; 0 <= a[i] <= 1000000; answers fit a signed 64-bit integer.

Example 1:

Input: 662 212277 252878 494640 400337 212115 542809 710587 323258 812503 401946 650097 346011 907272 861269 447253 898066 186072 110429 760705 598299 877462 281814 109407 302598 483779 444512 96918 379245 481440 49660 904001 170358 460089 235883 531030 371734 700627 286559 776314 343722 519388 326068 765269 723530 99534 867151 119295 775786 273029 549629 198882 676018 788969 572617 466797 334953 189231 797305 810240 626808 801847 437539 92846 355242 243360 44281 131986 73101 300844 364250 515550 457587 14093 679608 779821 912455 581758 614229 786176 859643 887288 776345 497011 222299 677372 337447 990523 600094 141788 50496 672291 349174 104559 34024 86501 939101 675962 362044 353348 609477 323195 958992 237663 979787 227928 621169 860140 659343 615229 503022 950534 934983 201303 76305 353185 99…
Output: 662

Example 2:

Input: 945 565514 940117 312677 369165 50318 132934 544035 365808 590881 992982 171168 982015 348712 297165 580516 611006 300306 942661 943914 734991 91295 265946 934110 195035 469388 638488 401401 812039 594739 644898 34504 22030 895739 614777 847316 190696 317426 653812 16308 695846 580679 920652 976075 900335 888425 617736 286745 818561 543952 350359 200003 579211 523281 29368 317940 24487 574476 595160 704282 545127 468575 99012 171776 655678 715756 409238 817044 195187 81270 799969 576534 216190 835434 770276 500651 68102 618034 500006 109452 58405 887350 102618 408343 863874 196995 527198 878064 645389 900805 274653 631964 423793 939601 323510 77148 330328 573484 527548 461956 134160 46159 427134 733409 810824 893681 298271 100938 378627 214012 621961 662834 589210 27144 733562 631978 61237…
Output: 945

Example 3:

Input: 661 356378 666568 351070 906358 655882 885305 146075 452570 717708 221179 553909 998891 186140 907524 407192 210610 795790 604274 914127 816872 189459 308624 352315 523309 865404 996915 73039 35371 511807 493307 450692 118476 895960 459527 375986 102095 94412 447667 926867 241697 495562 54854 680740 672977 386578 666741 587614 439677 40724 160765 810848 909279 628328 535618 637115 936541 983994 955646 318845 572542 473590 693807 84741 772991 673594 335421 309152 676776 417968 165635 852710 798997 267108 930484 450695 13486 142510 238874 657950 974219 203779 480997 349715 611522 156844 560019 692657 473634 194915 308524 669264 728824 81690 756798 719552 931814 879225 963754 607221 158835 655891 758310 176209 218364 986473 188287 500797 837785 623527 768690 908453 870649 317525 269993 803254…
Output: 660

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Gautam's Twilight scrolls - EASY Coding Problem | CodeTikki