CT1173

The Square Sum at Prismhaven

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Caravans arrive at the glass towers of Prismhaven with crates of scrolls, and Morgana the quartermaster must account for every last one. 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 <= 65; -100 <= a[i] <= 10; answers fit a signed 64-bit integer.

Example 1:

Input: 18 -89 -29 -8 8 -40 -24 -83 -83 -8 -90 -73 -32 -17 -47 -91 -53 -51 -65
Output: 59775

Example 2:

Input: 2 -39 -5
Output: 1546

Example 3:

Input: 1 -83
Output: 6889

Constraints:

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

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