CT22451

Anaya's parcels Reckoning

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Anaya the dispatch writer watches over the spice bazaar of Saffronia's stores of parcels. A careful computation stands between order and chaos. 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; -100 <= a[i] <= 10; answers fit a signed 64-bit integer.

Example 1:

Input: 197 -20 -92 -39 -3 -25 -68 -27 -71 -85 -92 -21 -63 -88 -60 3 -89 -78 -19 -68 -20 -6 -16 8 -25 -21 -13 -80 8 -99 -77 -1 -84 9 -72 -17 -14 0 -51 -45 -10 10 -9 -9 -48 -8 0 -50 -9 -86 -67 -79 -9 -57 -74 -66 -86 -31 -71 -58 -28 -38 -32 -26 -22 -95 -22 -40 8 -50 -40 -33 -80 -66 -99 -64 -21 -52 -65 -34 -43 -99 -46 -57 -29 -15 -30 -47 -22 -94 7 -18 -41 -37 -17 -81 -72 -33 6 -13 -73 -47 -81 -59 -97 7 -76 -33 -22 -58 -51 -53 -42 -39 -46 -7 -76 -45 -56 -98 -20 0 -97 -33 -2 -94 -99 -100 -81 -32 -92 -45 -50 -57 -67 -39 -35 -16 -30 -53 -98 -26 -19 -100 -41 -56 -16 -11 -87 -11 -91 -6 -11 8 -100 2 -35 -64 -50 -55 -99 -72 -48 -49 -50 -13 -56 -84 -57 -18 -24 -1 9 -42 -38 1 -3 -88 -55 -99 -43 -97 -86 -9 -44 -47 -48 -1 -71 -4 -71 -32 -64 -93 -44 -94 -8 -63
Output: 95

Example 2:

Input: 236 -50 -40 -43 -74 -93 -27 -2 -34 -64 -10 -52 -87 6 -77 6 -53 7 0 -41 -99 -26 -39 -48 -61 -9 -96 -59 -64 0 -57 -65 -25 -83 -28 -97 -44 -61 -34 -98 -61 -62 -79 -56 -79 7 -71 9 -14 -16 -61 -95 -60 -14 -86 -10 1 -42 -33 -51 1 -5 -10 3 -54 -88 -3 -18 -98 -19 -41 -77 -63 10 -5 -82 -36 -78 -13 -29 -99 -96 -34 -8 -4 -79 -62 -32 -6 -92 -34 -34 -26 -94 -25 -27 -67 -74 -49 -68 -60 -31 -68 -84 -79 -5 -60 -21 -11 -73 -32 -18 -5 -16 -4 -54 -4 -79 -18 -21 -32 -67 -5 -95 -32 -52 -40 -63 5 -49 -78 1 -40 -82 -68 -92 -31 -75 -81 -11 -78 -41 -19 -100 -28 -18 -51 -51 -92 -48 -34 -93 -73 -68 -42 -62 -65 -9 -33 -65 -74 -57 -1 -20 -100 -48 -99 -93 -10 -49 10 -14 -71 -10 -92 -97 -23 -68 -100 -70 -43 -15 -2 -98 -43 -11 -10 -6 -8 -58 -3 -37 3 -84 -61 -94 -10 -93 10 -99 -90 -95 -27 -62 -24 -13 -92 -66 -90 -31 -41 -40 -42 -4 -28 -68 -51 -64 -74 3 -32 -24 -57 -83 -82 -69 -5 -52 -5 -9 -78 10 -31 -42 -66 -44 -46
Output: 92

Example 3:

Input: 156 -15 -26 -51 -80 -53 -40 -79 -78 -92 -96 -43 5 3 -93 -63 -4 -91 10 -4 -60 -88 -54 -77 -85 -29 -41 -77 -36 -16 3 -53 -60 -51 -19 6 -58 -24 -52 -25 -16 -70 -18 -86 7 -22 -89 -51 -8 1 -84 -10 -35 -23 -60 -11 -85 -47 -7 -56 -26 5 -64 -39 -32 -65 0 -18 -75 -49 -76 -33 -47 -78 -66 -24 -51 -79 -54 -23 -28 -76 -82 2 -58 2 -72 -22 9 -33 -72 -95 -46 -8 -81 -62 -33 -23 -82 -97 -31 -14 -4 -82 -60 -79 -93 -26 9 -57 -68 -34 -11 -75 -40 -26 -56 -96 -58 -78 -56 -27 -92 -16 -12 -31 -100 3 -83 4 -67 -1 -30 -6 -50 -2 -34 -20 -56 -32 -71 -62 -52 -34 -71 -60 -23 -49 -5 -3 -1 -47 -6 -47 5 -59 -60
Output: 90

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Anaya's parcels Reckoning - EASY Coding Problem | CodeTikki