CT26226

The Distinct Count of Slitherwick

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Deep in the eel marshes of Slitherwick, Cyrus studies rows of scrolls entries. One clean number will settle the guild's oldest argument. 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 <= 272; 0 <= a[i] <= 1000000; answers fit a signed 64-bit integer.

Example 1:

Input: 261 184296 570158 237601 674280 347255 838534 102465 657223 780738 950661 531105 653711 425806 696971 197015 49306 799988 337513 608797 329081 601498 225487 652485 639690 116500 675416 170768 187984 382355 267160 311005 551119 955163 873135 775933 665637 926780 147456 382272 327748 595576 453188 629894 291482 111830 875711 530610 162284 150993 38321 565866 270154 248590 190872 44500 530024 199520 835062 964956 738877 46753 760853 337353 998471 328725 807784 972420 419782 299990 94570 665593 637368 855124 462129 944156 799256 276304 288755 797961 112451 200614 177892 913775 189951 308748 763732 457480 344616 44185 830728 841877 162259 275021 532811 956139 402859 133390 697432 370535 525113 973017 998230 452093 553698 281438 912648 401105 172443 230315 695350 978207 231551 211460 43689 20666…
Output: 261

Example 2:

Input: 249 32939 725494 256799 122473 785309 274711 482561 738154 465998 205429 955269 196202 64298 23221 254555 783191 396879 450238 143564 786814 730158 583402 256984 843524 76599 749349 159048 320643 670381 169268 993883 40789 843742 901966 670184 264295 637283 279653 86626 197149 571758 291950 6761 604046 98113 316245 106058 17236 322765 401248 956802 225254 703925 41797 329969 358630 713401 232802 63090 119552 9727 651328 559024 525074 329697 792156 128248 118834 501218 876932 143873 834108 734410 992212 443341 630926 268904 712322 860893 412199 184954 210509 700600 610095 443834 346165 105301 902283 26327 655873 559097 254422 459461 478504 517051 615698 216569 807933 684273 121821 985765 663384 347559 226473 295186 758339 968431 520331 338743 743153 401725 277473 580819 785764 299128 458860…
Output: 249

Example 3:

Input: 226 570648 442997 169497 42412 812003 422499 728199 635276 129674 332423 676482 663900 864401 340317 256082 11850 294193 967157 711384 423570 898031 703062 683490 756565 836723 409992 309664 638867 327103 164567 500648 723546 821529 773187 406946 892353 134653 372925 710492 394572 70737 73495 363268 339298 471409 474993 777840 572452 229077 559799 222123 741855 745047 95172 321070 737318 717782 268741 395628 712489 651227 520621 835088 513341 120879 81649 955291 496215 5617 211826 239017 492228 713098 106328 560607 520673 847781 428286 568517 331207 58298 385024 26419 647025 846940 846476 846777 541872 500259 627916 949453 265860 83081 723400 213497 152776 164302 970767 22216 269210 840130 891334 461248 944610 146237 993279 628336 201950 63077 545152 868255 799060 959070 758666 212306 5832…
Output: 226

Constraints:

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

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