CT27168

The Silent ingots of Weaver

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Weaver the registry keeper watches over the marble forum of Argentium's stores of ingots. 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 <= 362; -1000000 <= a[i] <= 1000000; answers fit a signed 64-bit integer.

Example 1:

Input: 279 -547164 -859454 -560572 -783863 -774541 -393557 -643593 -720486 -288389 -936584 -511151 -722117 -8357 -448611 -198607 -77414 -266649 -556281 -823846 -855587 -571056 -254220 -175407 -877588 -392035 -518452 -135322 -897335 -891875 -952944 -424552 -51659 -485539 -666459 -594497 -575363 -986791 -211529 -600422 -215455 -104075 -603613 -896670 -880874 -997826 -809957 -119910 -925924 -540885 -717119 -159918 -159707 -731331 -485948 -37663 -890456 -746906 -199082 -294585 -762242 -787888 -976460 -145946 -486407 -818796 -817690 -934538 -520193 -801397 -620671 -357734 -87675 -870284 -508113 -355405 -228089 -885488 -941320 -576691 4396 -14163 -666861 -63168 -348785 -782467 -89306 -695116 -239920 -796086 -297771 -334691 -183879 -872547 -93054 -684882 -616940 -327927 -844560 -183104 -156715 -794632 -…
Output: 94321050337154

Example 2:

Input: 13 -721498 -301540 -381531 -923695 -461613 -927986 -97381 -472709 -448498 -840208 -929139 -59384 -19198
Output: 4691739771646

Example 3:

Input: 243 -937681 -256944 -317782 -173931 -236429 -437826 -391824 -323940 -152417 -610446 -177777 -161010 -265339 -297595 -322157 -491362 -889220 -997411 -460546 -184238 -371676 -740477 -241382 -214415 -732352 -22475 -250252 -653719 -1036 -739934 -924508 -280179 -196374 -323811 -564090 -428076 -679169 -425991 -858396 -817976 -649342 -786482 -625138 -804349 -843982 -504640 -530111 -962701 -575448 -530168 -540172 -131653 -682205 -453405 -197902 -523214 -645855 -354654 -443524 -369076 -362067 -914189 -996832 -494358 -729348 -772377 -526234 -838674 -264021 -674907 -589128 -501618 -532150 -733663 -365482 -449231 -341222 -824369 -30146 -303868 7223 -735410 -416128 -474106 -884506 -349288 -851346 -244096 2164 -830135 -35416 -238112 -596805 -425361 -364564 -156199 -145429 -689810 -221907 -520426 -694482…
Output: 83582943688417

Constraints:

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

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