CT26643

The Dusky Square Sum

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Lata the factor watches over the quays of Driftwood's stores of scrolls. A careful computation stands between order and chaos. 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 <= 843; -100 <= a[i] <= 10; answers fit a signed 64-bit integer.

Example 1:

Input: 334 8 -85 -25 -38 -58 -80 -98 -38 -38 -76 -10 3 -55 -26 -62 -19 -16 -67 4 -100 -51 -2 6 -37 -5 -50 -22 9 -26 -59 -76 -90 -19 -8 -34 9 -17 -82 -91 -90 -74 -88 -17 -51 -12 -33 -68 -76 -25 -45 -88 -39 -8 -83 -31 -69 -72 -85 -10 2 -79 -35 -96 -15 -51 -55 -59 -97 -64 -11 4 -89 -48 -48 9 -51 -6 -64 -76 3 -68 -100 -35 -89 -18 -98 -60 -25 -95 2 -55 -47 -49 -96 -23 -87 -94 -2 -65 -68 -93 -75 -81 -49 -99 -70 -93 -12 -25 -34 -94 -18 -36 -76 -61 -87 -68 -95 -41 -79 -25 -77 -69 -20 -14 -75 8 -100 -99 -61 -20 -22 -10 -70 -91 -20 7 -13 -11 -10 -44 -87 -50 -24 -62 -89 -28 -58 -96 -12 -26 -93 -34 -24 -53 -51 -99 -60 -31 -57 -5 -29 -96 -80 2 -98 -3 -88 -49 -70 -53 -33 -9 -40 -36 -53 -30 -23 -91 -7 -16 -48 -26 -69 -21 -6 -10 -54 -14 -23 -36 -19 -85 -67 -38 0 -61 -48 -52 -12 -54 -55 -33 -80 -47 -85 -60 -20 -2…
Output: 1100185

Example 2:

Input: 663 -89 -78 -97 -91 -17 -53 -68 -77 -45 7 -65 -88 -43 -8 -47 -75 6 -39 -68 -21 2 1 -6 -30 -75 -7 -90 -97 -80 -46 -3 -43 -58 -50 -55 -74 -2 -63 -27 -37 -82 -35 -26 -2 -15 -81 -47 -30 -95 -46 -66 -66 -66 -56 -100 -34 -82 3 -57 -84 -78 5 -80 -68 -77 -31 -43 -50 -88 -17 -41 -21 -33 -14 -92 -35 -37 8 -18 7 2 -81 -52 -99 10 -55 -9 9 -87 -7 -38 4 -79 -8 -12 3 -22 -94 -4 0 -85 -40 -44 -92 -31 6 -13 -83 -94 -88 -65 -7 -55 2 1 -10 -69 -13 -65 -18 -82 -11 -67 -37 -59 -24 -52 -92 -95 4 -68 -20 -43 -60 -58 3 -88 -66 -35 -42 -89 -55 -56 -84 -100 -22 -6 -87 0 -47 -44 -58 -58 0 -12 -8 -79 -96 -80 -67 -17 -66 -24 -97 -90 -27 -91 -58 -91 -56 -8 -62 -25 -42 -38 -66 -76 -29 -16 -8 -97 3 -81 -89 -49 -48 -30 -14 -93 -76 -63 -43 -40 1 -43 -30 -25 -88 8 -42 -71 8 4 -65 4 -88 -41 -98 -97 10 -20 -33 -15 -10 -73 -12…
Output: 1987892

Example 3:

Input: 829 -3 -61 -72 -68 -50 -85 -49 -1 -77 -41 -79 -40 -73 -76 -77 -48 -86 -70 -63 -89 2 -26 -15 -47 -25 -72 -36 -58 -84 -70 -10 -20 -78 -45 8 -73 8 3 -5 -88 -3 3 -76 -78 -26 -41 -16 -57 -79 -44 -57 -13 -30 -48 -65 -9 -68 -54 -66 -50 -16 -47 -27 -95 -93 -44 -39 -69 6 -58 -21 -64 -53 -37 -52 -90 -79 -60 -46 9 -28 -58 -2 -75 -69 -3 -2 -83 -57 -52 -51 -7 -8 2 -10 -69 -46 -48 -72 -25 -22 3 -88 -18 -5 -60 -77 0 -90 -89 -15 -16 -6 -72 -32 -36 -82 -19 -40 -26 -37 -77 -92 -24 -32 -23 -74 -68 -26 -6 -1 -14 -95 -70 -32 -70 -92 -53 -34 4 -49 -26 -72 8 -26 -91 -77 -65 -43 9 -60 -57 -29 -30 -7 10 -63 -44 -54 -67 -81 -37 -39 -2 9 -16 -64 -77 -24 -26 -64 -58 -88 4 -7 -74 -68 -80 -79 -95 -68 -53 -23 -20 -36 -69 10 -16 -45 -27 -87 -84 -72 -81 -9 -3 -81 -62 -82 -39 -60 -67 -52 -93 -85 -44 -83 -61 -68 -69 1 -8 -5…
Output: 2496328

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.