CT23076

Tomas's Square Sum Ledger

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Tomas runs the mill at the crystal caves of Luminar. Today the books show a list of parcels, and the numbers must be worked out before sundown. 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 <= 526; -1000000 <= a[i] <= 10; answers fit a signed 64-bit integer.

Example 1:

Input: 67 -911407 -837849 -957525 -183380 -57878 -778507 -354569 -474630 -597578 -445025 -73602 -407127 -757559 -167132 -307508 -775075 -184604 -730507 -714093 -913159 -353148 -92114 -277043 -715674 -279727 -163806 -219048 -659367 -906611 -944198 -13208 -301012 -549048 -416261 -310270 -242285 -679467 -249023 -581883 -141871 -219525 -614430 -720316 -651847 -392721 -2610 -645308 -492405 -644747 -533458 -775416 -852215 -990659 -545613 -949207 -867624 -719181 -168977 -833566 -259697 -447861 -728997 -516918 -521800 -842053 -597515 -536939
Output: 23082012522527

Example 2:

Input: 445 -543480 -160653 -974888 -927610 -7474 -682129 -529447 -59910 -544085 -38732 -797347 -375550 -132463 -937681 -217604 -947798 -330095 -86311 -369151 -153072 -692975 -139937 -82680 -794257 -105005 -890917 -806053 -687743 -347721 -404749 -22954 -706513 -349183 -984934 -481867 -614637 -979592 -344416 -634062 -375219 -404801 -254489 -865040 -418735 -754151 -708530 -178794 -427373 -718417 -861269 -336161 -66773 -496787 -995294 -971703 -693243 -224012 -692298 -726668 -476102 -129264 -494846 -313232 -885678 -742246 -857395 -294343 -520116 -185503 -40827 -706411 -263035 -611722 -392482 -401056 -314735 -979809 -619146 -683992 -232740 -213149 -30984 -621447 -780042 -409313 -192829 -423898 -778064 -853915 -990093 -512119 -192895 -901453 -518815 -786065 -486767 -760637 -720244 -406899 -540276 -71971…
Output: 148315550794713

Example 3:

Input: 454 -143325 -312363 -838457 -792220 -640024 -377900 -307821 -216505 -463352 -429827 -118739 -128588 -187733 -325144 -780552 -742011 -295477 -432654 -871088 -360517 -126326 -618788 -356493 -130461 -604768 -532270 -609586 -863834 -329891 -877400 -30155 -56340 -653379 -640434 -396973 -35460 -406539 -164082 -821377 -323729 -566924 -879015 -135179 -431698 -130159 -5387 -935008 -626590 -619117 -649858 -336278 -765746 -905715 -166367 -162467 -113293 -398689 -704763 -10755 -768320 -962030 -453150 -332279 -111513 -462166 -68720 -903812 -830706 -579317 -258318 -385647 -327013 -189739 -831204 -637964 -830057 -879986 -852293 -307686 -670403 -931373 -953760 -189760 -231104 -495883 -929535 -398176 -134896 -208752 -150816 -767262 -885944 -793667 -525528 -228914 -829535 -165797 -955774 -247739 -705213 -93…
Output: 160702290724764

Constraints:

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

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