CT24368

The Square Sum of Shimmerdeep

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Morning light hits the opal reefs of Shimmerdeep as Lysander unrolls the day's manifest of coins. The tally will decide the next shipment. 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 <= 281; 0 <= a[i] <= 10; answers fit a signed 64-bit integer.

Example 1:

Input: 15 2 1 4 6 4 0 10 0 5 4 5 1 1 2 8
Output: 309

Example 2:

Input: 177 0 1 9 5 0 1 3 5 10 7 0 4 0 7 9 9 7 5 4 2 9 4 4 4 9 6 3 7 10 4 10 5 9 4 7 7 8 1 9 10 0 6 7 7 4 1 0 1 8 3 2 1 9 8 9 4 0 3 7 2 6 10 1 6 6 0 6 9 0 3 5 3 7 2 5 4 1 0 5 10 0 6 6 8 9 10 3 2 8 7 10 8 1 6 2 10 0 10 0 5 7 8 5 4 9 5 3 2 5 1 1 8 9 9 8 1 9 5 4 0 0 6 5 1 3 6 0 7 9 2 1 0 9 9 8 5 8 2 10 0 6 8 9 0 2 0 5 6 5 3 6 9 10 0 4 0 10 10 4 9 0 8 2 5 3 10 8 8 8 4 1 9 5 7 5 0 1
Output: 6370

Example 3:

Input: 64 3 1 5 2 5 7 7 10 7 0 6 1 10 4 2 0 4 10 0 8 8 10 10 3 9 9 6 7 2 6 9 0 5 4 5 6 5 5 2 10 10 10 9 6 0 6 8 5 0 5 2 1 7 0 10 6 5 6 2 4 1 4 9 1
Output: 2382

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The Square Sum of Shimmerdeep - EASY Coding Problem | CodeTikki