CT1955

Topaz tickets Square Sum

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

At the maple sugarbush of Saprun, Bhavi records each tickets in a worn leather ledger. The guild wants answers, not guesses. 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 <= 43; 0 <= a[i] <= 10; answers fit a signed 64-bit integer.

Example 1:

Input: 26 7 0 10 9 4 4 0 10 7 1 5 7 0 2 9 10 1 10 10 7 3 5 1 10 9 2
Output: 1141

Example 2:

Input: 24 1 4 7 8 6 6 9 0 1 6 7 5 8 4 1 3 4 9 1 9 7 7 10 2
Output: 865

Example 3:

Input: 32 2 8 6 10 8 2 10 2 1 9 9 1 10 0 2 3 0 6 8 8 1 7 9 2 10 6 6 1 9 7 1 2
Output: 1260

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Topaz tickets Square Sum - EASY Coding Problem | CodeTikki