CT1265

The ingots Square Sum Puzzle

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Deep in the gull cliffs of Screech Point, Finn studies rows of ingots entries. One clean number will settle the guild's oldest argument. 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 <= 44; 0 <= a[i] <= 1000000; answers fit a signed 64-bit integer.

Example 1:

Input: 40 4369 5908 8247 5605 4491 1375 6741 468 9873 4057 8814 5480 4864 1670 28 1616 2869 432 6093 1699 663 2762 101 9924 1140 3223 2843 4519 3865 6705 2820 4502 4857 9835 4437 5415 4159 9383 3573 7943
Output: 1105676114

Example 2:

Input: 2 323 9543
Output: 91173178

Example 3:

Input: 6 5791 4625 382 63 8212 7736
Output: 182358839

Constraints:

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

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