CT27730

The Obsidian Distinct Count

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Legend says the vault under the tannery row of Leatherwick opens only for a perfect tally of coins. Iker means to find out. 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 <= 739; -1000000 <= a[i] <= 10; answers fit a signed 64-bit integer.

Example 1:

Input: 325 -591294 -89047 -700114 -988824 -688429 -945779 -881075 -298089 -253955 -695669 -348238 -924347 -182301 -631981 -705947 -766041 -344740 -823323 -846174 -251316 -595036 -975433 -624440 -374948 -743728 -278686 -280092 -743937 -184101 -330700 -46095 -943615 -798245 -323823 -778936 -248488 -658424 -259029 -656824 -588883 -27078 -729015 -165647 -137837 -395786 -113208 -657227 -341034 -528759 -642177 -1288 -456826 -789084 -136221 -527921 -639976 -416635 -428378 -474480 -428000 -230143 -820708 -848237 -891919 -899299 -801682 -345187 -620078 -632265 -435425 -918223 -108347 -589426 -699822 -308599 -550959 -368629 -255376 -921650 -596228 -90939 -55784 -437504 -362115 -821601 -533062 -941987 -739499 -241931 -116922 -267908 -659161 -18101 -523619 -707175 -80247 -197475 -570944 -505043 -92754 -23055…
Output: 325

Example 2:

Input: 397 -254832 -72872 -172880 -414491 -295220 -306697 -420457 -365830 -989775 -549958 -291425 -551731 -460645 -455452 -607324 -907810 -11336 -746816 -299894 -441986 -60145 -744134 -156683 -235287 -556158 -209426 -825310 -313693 -962588 -903348 -615422 -943413 -369386 -170374 -394146 -111035 -802895 -227719 -808491 -573097 -162000 -850628 -808378 -464387 -962541 -823323 -240960 -825868 -42265 -507379 -579419 -915555 -523908 -97871 -543031 -299223 -944019 -809127 -865254 -37800 -614097 -17609 -828586 -206271 -805602 -810523 -740005 -694257 -548737 -292906 -672618 -812121 -767264 -867832 -105844 -912429 -330343 -406029 -808807 -939334 -927789 -781009 -398527 -629927 -664921 -878248 -926948 -197022 -116952 -798193 -113330 -264051 -220414 -17008 -85953 -334278 -791163 -621069 -396229 -970907 -7116…
Output: 397

Example 3:

Input: 250 -483607 -812777 -734122 -571227 -208889 -737130 -761103 -738006 -776927 -428079 -249709 -41103 -913344 -350006 -350934 -526904 -44912 -52673 -712394 -906145 -544563 -101201 -539741 -35041 -18225 -893218 -221538 -739159 -115945 -374691 -346932 -92672 -983584 -374894 -127279 -116880 -972637 -548532 -405619 -328001 -796462 -908635 -1486 -271499 -690346 -609996 -241189 -697406 -402943 -677558 -828365 -382018 -408294 -98522 -458607 -137060 -545792 -659619 -392468 -896028 -231505 -34636 -485398 -640600 -794313 -8271 -334594 -906111 -653103 -305930 -544091 -492110 -348293 -567109 -918704 -506567 -742030 -510088 -303939 -884873 -900168 -650385 -711320 -158939 -825408 -206431 -537622 -434284 -500767 -954271 -55202 -215998 -385003 -56516 -505889 -779446 -329768 -243113 -39451 -300523 -803164 -53…
Output: 249

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The Obsidian Distinct Count - EASY Coding Problem | CodeTikki