CT329

Last lanterns of Wynne

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

It is audit day at the poppy fields of Scarlet Plain. Wynne spreads the lanterns records across the table and picks up a sharp pencil. 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 <= 69; -1000000 <= a[i] <= 1000000; answers fit a signed 64-bit integer.

Example 1:

Input: 21 590162 -124605 -50395 323946 -568417 90132 867813 -822930 434438 374899 381590 -971614 856147 -483784 -181597 370279 -378685 656450 713081 162695 -207431
Output: 21

Example 2:

Input: 66 -397366 394037 557587 448430 872574 244956 -427012 416622 -835086 554438 -679534 -816401 337971 -826697 -818914 -884860 158889 -148581 -791864 524205 -720965 -450759 -769535 -199917 267111 -534076 -551237 -857237 -443847 -515858 -512701 -201232 443005 -533585 -97249 735798 -602877 806253 -566384 -741113 398100 -899742 621874 174961 -156810 759726 -328689 719078 -941644 709731 -290142 219063 392588 491057 -358069 459539 -985448 356098 -136647 -541784 -926341 937528 496421 -71592 -275330 -3099
Output: 66

Example 3:

Input: 12 -407451 -667060 382581 227812 -815969 269080 347267 344595 65215 832268 735497 24961
Output: 12

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Last lanterns of Wynne - EASY Coding Problem | CodeTikki