CT1463

The readings at Leatherwick

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Curator inherited the observatory at the tannery row of Leatherwick along with its curious bookkeeping system for readings. Time to make sense of it. Task: Read n integers and print the sum of their squares. Input format: First line: n. Second line: n space-separated integers. Output format: Print the sum of squares. Constraints: 1 <= n <= 55; -100 <= a[i] <= 10; answers fit a signed 64-bit integer.

Example 1:

Input: 47 -45 -67 -28 -66 -21 -99 -32 5 -78 -68 -45 -79 -26 -39 -92 2 -23 -58 -85 2 -7 -81 -67 -13 -99 -17 2 -41 -95 -79 -86 4 -40 -22 -23 -53 -54 -4 -65 -67 -22 -62 0 -41 -79 -99 -22
Output: 149030

Example 2:

Input: 31 -29 -31 -25 -65 -29 -24 -23 -99 -55 -22 -98 -31 -78 -67 -37 -20 -59 -66 -54 9 -23 8 8 -61 -75 -42 -41 -17 -63 3 -51
Output: 75965

Example 3:

Input: 28 4 -70 9 -84 -8 8 -33 -86 -45 -12 4 -95 -67 -30 7 -35 -13 -44 -82 -12 -3 -87 -68 -29 -49 -7 -7 -28
Output: 63838

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The readings at Leatherwick - EASY Coding Problem | CodeTikki