CT22145

The Horselord Plains Square Sum

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Every season at the steppe camp of Horselord Plains, someone must rebuild the damaged itinerary. This year the task falls to Jeweler, armed only with the parcels register. 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 <= 888; -1000000 <= a[i] <= 1000000000; answers fit a signed 64-bit integer.

Example 1:

Input: 94 -687094 -838180 -465751 -225955 -916669 -413499 -934701 -649673 -128300 -250620 -469407 -589230 -645024 -22228 -61132 -36488 -857401 -675259 -800165 -132209 -365624 -883949 -159080 -397087 -904057 -351305 -678804 -134341 -222059 -588314 -246225 -44343 -947567 -598839 -393493 -872197 -628330 -428831 -103594 -57526 -881896 -674586 -798751 -314348 -70176 -210506 -798454 -823982 -468956 -417671 -351882 -372787 -706382 -985233 -266862 -378964 -655458 -498807 -737057 -587872 -847102 -98256 -554459 -52351 -598892 -888519 -385683 -611683 -835783 -752021 -225900 -118104 -556504 -245050 -532789 -22008 -315015 -437413 -691710 -484442 -748994 -50764 -304098 -573983 468 -109277 -345309 -112990 5332 -662336 -201897 -771052 -127553 -116843
Output: 27580240450346

Example 2:

Input: 323 -822630 -754499 -691489 -676600 -882905 -506157 -794311 -442148 -726519 -129750 -333054 -961323 -608047 -995450 -860091 -922890 -29401 -41880 -691546 -105660 -997752 -950547 -379380 -690601 -61558 -386539 -383382 -269238 -904728 -194521 -932931 -313126 -707973 -670206 -742304 -942064 -812883 -807681 -454815 -333184 -101663 -977914 -230128 -381641 -620144 -545732 -806219 -432756 -885650 -826185 -750462 -830906 -579692 -424828 -895825 -98649 -796020 -589251 -465153 -19845 -156689 -624877 -331251 -227865 -914786 -375341 -665093 -828714 -307717 -751181 -754266 -242216 -235441 -948591 -450527 -314387 -755136 -255831 -54266 -249215 -713915 -507299 -38335 -297712 -924689 -726753 -87037 -520398 -677667 -535799 -351975 -987503 -338921 -576839 -314776 -138980 -657260 -357595 -253575 -975564 -640…
Output: 113701942615878

Example 3:

Input: 432 -108023 -491084 -302367 -451230 -916189 -584413 -663522 -705775 -500159 -712873 -129530 -644295 -529962 -253281 -148427 -730832 -752287 -318644 -9013 -903422 -289061 -862193 -138667 -624220 -713666 586 -485422 -525523 -726084 -489582 -224933 -666790 -32414 -619183 -654958 -70169 -917143 -469180 -892719 -869267 -573328 -842633 -300746 -242943 -187891 -728630 -787156 -910184 -191977 -158666 -22178 -646310 -973561 -670772 -658520 -888294 -571891 -720306 -657865 -983808 -283614 -993908 -658823 -403859 -302496 -34501 -488552 -997465 -831112 -398819 -583751 -168891 -61821 -833639 -310772 -545412 -811826 -314022 -884895 -822399 -690969 -160902 -863981 -797126 -433612 -371637 -327920 -320032 -965244 -344810 -609312 -579891 -882030 -242324 -907201 -647654 -182892 -610004 -325121 -855486 -994054…
Output: 142536871255607

Constraints:

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

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