CT2110

Kael's Rustic Ledger

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Kael inherited the counting house at the poppy fields of Scarlet Plain along with its curious bookkeeping system for parcels. Time to make sense of it. 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 <= 59; -1000000 <= a[i] <= 10; answers fit a signed 64-bit integer.

Example 1:

Input: 59 -394813 -781943 -193455 -634456 -876397 -675753 -528846 -324480 -34141 -850341 -912604 -87365 -470743 -59274 -332859 -572589 -671199 -404302 -46187 -281663 -648436 -213799 -99106 -475001 -144655 -193813 -981642 -238444 -296558 -980686 -851937 -17771 -12828 -293800 -950817 -13029 -998403 -371570 -640756 -798409 -349594 -794920 -198624 -626336 -707445 -707361 -238622 -489405 -587762 -604228 -245632 -125049 -20784 -362747 -444525 -328295 -313224 -231316 -175702
Output: 59

Example 2:

Input: 26 -870664 -596293 -355412 -985617 -656930 -925009 -701579 -101351 -963349 -307956 -765404 -54098 -395368 -713160 -62435 -343833 -25439 -866050 -26609 -547655 -667251 -380444 -61415 -31230 -705075 -663774
Output: 26

Example 3:

Input: 36 -619434 -292836 -309200 -331107 -191116 -902177 -414271 -325763 -754431 -190621 -965506 -479503 -440895 -855894 -858609 -404294 -111616 -443017 -436372 -781387 -709600 -584022 -752471 -968890 -477506 -25470 -959837 -743797 -453599 -686352 -61752 -61358 -603352 -234349 -430322 -759257
Output: 36

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Kael's Rustic Ledger - EASY Coding Problem | CodeTikki