CT2115

The tickets at Sleekwater

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Caravans arrive at the otter slides of Sleekwater with crates of tickets, and Sage the inventory keeper must account for every last one. 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 <= 88; -1000000 <= a[i] <= 1000; answers fit a signed 64-bit integer.

Example 1:

Input: 63 -166236 -126068 -413967 -716312 -401604 -106898 -461849 -928888 -694278 -797340 -971595 -525638 -988834 -926834 -187960 -16069 -845407 -650684 -206979 -229213 -249317 -756537 -666718 -776968 -70232 -725875 -609447 -807512 -379474 -879852 -409594 -36544 -50061 -658460 -678624 -372017 -944903 -14261 -335955 -93351 -959256 -534214 -665553 -933906 -649169 -539569 -991850 -580828 -735756 -513794 -338782 -7778 -908586 -545552 -100660 -522869 -285387 -75028 -345468 -350955 -95820 -341151 -396790
Output: 63

Example 2:

Input: 85 -240274 -644073 -974961 -128106 -732865 -55570 -246279 -528607 -714540 -374777 -266978 -545536 -688046 -216271 -263149 -70119 -213645 -179116 -113376 -828758 -166852 -462428 -985047 -314420 -52449 -375293 -237310 -606240 -768992 -520279 -742573 -788749 -56621 -801752 -598577 -953449 -630161 -605083 -688968 -164179 -713970 -14091 -552351 -81973 -444440 -313409 -298081 -879823 -666129 -518463 -67486 -426270 -974308 -627406 -631325 -558476 -402865 -193069 -211191 -747480 -801521 -315181 -378240 -276757 -568280 -101035 -361864 -398255 -101564 -241790 -891994 -169412 -354186 -424556 -810857 -606188 -446171 -966943 -896929 -572209 -490026 -156188 -524386 -23019 -548121
Output: 85

Example 3:

Input: 81 -485983 -284752 -905506 -61985 -862896 -865550 -304350 -885250 -693988 -679244 844 -644791 -336249 -48645 -348017 -194773 -871256 -516341 -781303 -326125 -754912 -772374 -655797 -72114 -116436 -270022 -211878 -883630 -820107 -819753 -464620 -186190 -389414 -784331 -52492 -491575 -267537 -658478 -183373 -37156 -727822 -524798 -27129 -649448 -381788 -721863 -313402 -692595 -258777 -855362 -595820 -139435 -807190 -62440 -14337 -510862 -707303 -222357 -687940 -35021 -201183 -166826 -350459 -15522 -342639 -787664 -923323 -565090 -85906 -385685 -453678 -263268 -227419 -113494 -530992 -269220 -830508 -319718 -619749 -926002 -398908
Output: 81

Constraints:

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

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