CT25783

Galen's Misty lanterns

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

At the honey farms of Buzzwell, Galen records each lanterns in a worn leather ledger. The guild wants answers, not guesses. 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 <= 710; -100 <= a[i] <= 1000; answers fit a signed 64-bit integer.

Example 1:

Input: 293 283 166 571 998 231 333 15 637 18 393 -5 687 245 927 878 897 400 125 569 144 690 67 801 917 419 957 -63 366 480 181 6 177 563 795 106 911 578 96 804 752 199 491 483 -88 242 183 726 89 239 884 860 739 529 934 435 393 470 305 69 213 391 603 -26 487 75 633 825 800 395 362 377 812 794 823 405 98 139 753 168 552 895 489 50 641 -46 531 833 652 640 310 624 204 470 456 686 366 959 601 -42 459 845 -89 291 22 -79 169 130 542 903 797 457 904 266 682 189 672 949 970 445 353 767 821 325 479 445 343 201 236 740 723 165 193 950 374 92 712 177 750 522 814 689 927 428 954 528 181 477 689 717 779 -27 374 173 363 157 435 968 375 273 577 685 801 447 92 550 958 162 538 591 865 -98 401 302 -8 448 214 410 483 124 290 465 -95 978 242 632 973 804 -97 284 151 394 391 755 328 371 -6 18 634 858 602 403 907 17 852…
Output: 259

Example 2:

Input: 601 4 771 277 342 343 692 998 898 332 977 293 940 884 256 612 763 -13 23 513 476 -33 589 865 552 270 137 997 991 916 20 226 259 135 672 423 680 -80 29 970 389 861 841 86 320 946 766 401 -6 229 294 864 479 199 935 -100 693 448 950 -94 774 486 -58 -21 42 168 390 986 374 388 662 760 993 392 162 200 510 123 802 112 3 319 18 -55 291 429 549 -41 50 807 211 854 549 71 -92 928 973 841 599 779 820 167 696 265 770 965 733 984 705 227 955 249 330 465 693 357 896 225 221 687 450 278 498 164 173 249 462 622 653 264 246 655 31 500 734 70 827 -54 40 658 -88 370 643 143 -94 385 568 719 469 960 -66 -44 42 981 888 911 953 481 481 807 53 688 774 405 -69 465 907 -12 587 484 125 359 696 121 784 123 513 6 219 805 486 48 874 104 773 982 911 555 36 416 953 820 372 335 829 412 443 642 550 841 571 470 781 717 735 4…
Output: 464

Example 3:

Input: 449 452 405 762 77 936 238 173 479 462 -57 985 408 432 721 567 386 976 654 809 -80 16 -5 704 610 773 283 391 894 890 494 346 343 108 184 215 70 -78 685 723 660 887 910 -84 480 131 442 698 840 506 633 774 358 554 576 -46 736 334 777 544 657 805 312 43 122 315 411 979 -54 565 147 862 896 483 818 398 344 -48 649 -80 355 70 748 61 464 869 689 516 916 917 748 293 54 719 352 520 616 930 586 695 602 96 256 2 115 593 77 76 339 318 219 355 863 473 524 668 145 -31 519 73 219 274 1 -98 717 195 245 310 56 -7 -43 802 86 691 103 224 499 -45 412 919 261 389 646 213 905 256 177 862 838 420 250 -35 188 944 677 146 -78 547 734 929 723 107 858 265 64 215 782 13 404 516 473 597 310 66 502 582 237 591 621 928 22 23 831 761 444 219 235 5 -81 136 129 390 698 670 75 998 86 322 606 564 874 308 165 841 160 868 396 …
Output: 374

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Galen's Misty lanterns - EASY Coding Problem | CodeTikki