CT23709

The Misty scrolls of Vesper

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Vesper found an old ledger of scrolls in the studio attic at the northern keep of Frostgate. The margin notes pose a precise question. 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 <= 236; 0 <= a[i] <= 10; answers fit a signed 64-bit integer.

Example 1:

Input: 233 2 1 0 4 7 4 0 3 10 9 2 2 0 3 9 5 5 9 7 10 6 9 9 7 10 6 5 5 5 4 10 2 4 3 0 9 9 4 4 7 1 7 0 5 1 2 9 9 9 3 3 7 6 0 3 4 4 3 4 5 8 2 9 7 6 8 0 6 9 3 6 7 6 3 0 3 8 2 6 5 4 8 8 10 3 3 1 6 6 7 9 3 1 0 6 3 10 1 0 4 10 8 9 1 3 2 5 3 4 10 3 5 3 4 8 5 10 2 7 10 6 2 4 6 6 10 4 8 5 5 7 0 7 3 2 1 3 10 5 2 8 9 8 2 7 4 10 0 2 10 2 1 9 8 7 10 8 6 1 4 10 9 7 6 2 2 1 4 0 8 1 2 3 0 1 4 10 10 6 1 7 9 6 5 6 2 6 0 4 3 8 3 3 5 5 2 6 6 10 8 7 1 4 4 3 4 2 2 2 2 3 2 5 10 8 0 4 6 2 10 9 10 10 7 7 8 5 7 3 10 2 4 4
Output: 8092

Example 2:

Input: 89 2 0 7 4 0 0 8 5 2 1 4 9 10 9 0 6 10 2 9 1 4 4 8 3 5 8 3 10 2 8 10 10 1 3 1 0 9 5 6 9 1 4 8 3 10 1 4 2 10 9 6 4 9 4 1 0 3 4 2 8 10 1 4 8 1 1 1 10 4 3 3 7 0 10 0 3 0 3 4 8 3 1 9 0 3 7 6 2 9
Output: 2938

Example 3:

Input: 42 6 2 10 1 3 4 0 10 0 7 10 3 4 10 9 9 6 9 2 5 8 9 7 1 9 5 10 0 7 9 6 10 9 0 0 9 6 5 10 3 10 2
Output: 1951

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The Misty scrolls of Vesper - EASY Coding Problem | CodeTikki