CT23508

Last ingots of Botanist

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Caravans arrive at the ember dunes of Ashfall with crates of ingots, and Botanist the cartographer must account for every last one. 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 <= 528; -1000000 <= a[i] <= 10; answers fit a signed 64-bit integer.

Example 1:

Input: 323 -69022 -387603 -6786 -114476 -381502 -417027 -728401 -871647 -953732 -396441 -831561 -767390 -376646 -831923 -462537 -373222 -737150 -946197 -621613 -428375 -138543 -140685 -681018 -495200 -886563 -148060 -369910 -455179 -356303 -917498 -192451 -441026 -940605 -447760 -329600 -775275 -798237 -839617 -646096 -153259 -349236 -407072 -723387 -589663 -262331 -62491 -246426 -464191 -976722 -99230 -273223 -194822 -518713 -348742 -193347 -259182 -249390 -673369 -731743 -383225 -376121 -812016 -167825 -856474 -38289 -945194 -424689 -637744 -161767 -353993 -954954 -220877 -635878 -152457 -152256 -949326 -797512 -493409 -641838 -86444 -415718 -113399 -872366 -176834 -678581 -206860 -227626 -603888 -66343 -787912 -294760 -595219 -334279 -651332 -214515 -638383 -553102 -220947 -40267 -572832 -6004…
Output: 106623628825153

Example 2:

Input: 438 -684135 -805842 -630958 -914074 -553469 -421850 -310005 -460767 -973392 -933239 -206836 -163788 -521366 -423317 -601307 -623791 -79678 -570986 -779622 -736519 -445209 -219388 -116886 -618230 -232383 -7451 -522108 -455043 -224600 -125024 -206051 -507687 -291791 -79981 -353899 -292214 -241910 -21592 -199408 -404155 -663431 -924206 -133217 -49481 -480328 -438702 -47319 -779519 -842828 -776392 -224093 -478863 -267006 -765207 -227603 -185738 -176710 -860455 -573422 -1386 -3824 -950187 -61409 -873981 -947692 -453580 -769649 -440751 -387123 -133643 -998678 -958037 -709904 -766708 -732970 -340086 -70205 -982572 -701497 -582181 -875729 -846198 -876906 -558125 -985206 -819471 -957040 -459229 -393384 -44227 -318291 -93455 -809715 -529687 -729170 -572531 -980202 -596432 -597740 -660699 -488001 -65…
Output: 149395373343238

Example 3:

Input: 304 -702217 -472391 -855433 -310719 -193588 -502672 -287688 -119517 -84200 -707247 -581202 -846324 -421018 -129102 -936741 -326601 -800038 -349785 -819731 -527981 -881806 -862823 -552452 -804588 -585635 -119528 -420954 -78880 -330971 -557259 -257997 -333166 -630584 -997653 -442782 -48983 -154176 -888813 -437909 -669163 -371002 -76439 -242175 -87683 -17217 -461855 -872093 -159605 -536417 -870250 -530634 -877294 -958744 -633877 -693850 -930800 -130163 -458568 -467035 -203918 -749344 -972653 -74595 -749323 -443226 -629819 -362719 -3709 -734284 -114143 -855796 -192078 -661396 -54509 -896318 -889886 -196352 -247052 -321723 -325357 -237355 -146743 -42428 -362036 -812815 -657044 -565348 -163867 -113669 -364554 -906632 -205028 -811771 -757896 -943429 -588307 -511926 -437856 -813008 -69295 -941902 …
Output: 95703804692576

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Last ingots of Botanist - EASY Coding Problem | CodeTikki