CT24752

The Square Sum of Longlegs

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Morning light hits the heron rookery of Longlegs as Aria unrolls the day's manifest of crates. The tally will decide the next shipment. 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 <= 552; -1000000 <= a[i] <= 1000000000; answers fit a signed 64-bit integer.

Example 1:

Input: 338 -467842 -701847 -564410 -403617 -377031 -949660 -655371 -433281 -483248 -442552 -406204 -213680 -60140 -988627 -775055 -528511 -215317 -215057 -478760 -162154 -494701 -431331 -55397 -758522 -132293 -41551 -512276 -175439 -300421 -605041 8078 -872252 -150141 -69771 -272535 -239357 -524847 -481853 -833978 -373247 -855280 -796211 -95826 -789107 -917174 -261149 -706261 -110942 -259173 -276095 -513924 -689001 -332847 -235267 -603031 -818290 -164348 -120178 -232690 -655008 -217785 -492275 -148407 -154736 -651015 -619245 -197098 -234721 -19754 -62408 -505283 -128835 -438278 -532825 -329275 -240683 -12969 -459101 -402456 -659538 -319879 -255062 -56491 -706748 -636626 -227345 -764595 3 -735823 -342580 -908538 -312696 -898537 -901030 -78213 -455372 -965896 -571621 -547049 -485082 -775320 -610606…
Output: 107412030925455

Example 2:

Input: 210 -223940 -437457 -137950 -927759 -498639 -177276 -835136 -74846 -763339 -895197 -668077 -245295 -784557 -97411 -19112 -650512 -680471 -866406 -431123 -84056 -515285 -35342 -165972 -80211 -706285 -559416 -477383 -971157 -345822 -796548 -500306 6405 4231 -582290 -240616 -738853 -969991 -277956 -640028 -70905 -518711 -68970 -420434 -672774 -252605 -540779 -314442 -310214 -582557 -19527 -210224 8954 -271586 -52994 -26016 -587192 -386932 -747435 -238216 -361640 -722580 -647167 -902501 -425664 -728172 -636521 -926164 -411595 -791794 -772761 -607462 -570203 -814069 -770584 -203854 -969775 -256007 -622936 -395237 -209490 -375204 -336661 6594 -481074 -106333 -708300 -138759 -641666 -291855 -863191 -346168 -86661 -37963 -196940 -468127 -965640 -193980 -425391 -424383 -198547 -231590 -701037 -8708…
Output: 65385186250771

Example 3:

Input: 392 -475845 -389202 -412669 -388186 -93167 -870669 -806496 -952167 -463628 -843559 -628610 -143184 -419716 -394989 -733539 -477713 -611977 -408263 -427219 -464352 -934758 -107988 -817789 -456082 -599685 -483163 -648064 -397642 -616339 -646635 -584271 -58745 -856244 -518758 -466858 -169894 -889492 -698860 -978667 -245125 -862723 -430488 -16478 -971803 -854545 -362891 -617652 -176016 -218892 -755292 -824698 -605084 -83500 -723147 -90076 -540007 -734157 -140894 -804074 -509572 -447712 -110924 -277184 -52785 -438491 -368170 -340958 -975631 -300897 -113334 -368490 -139923 -692464 -569879 -94935 3587 -295464 -498883 -341135 -355438 -939618 -598387 -883730 -420783 -821531 -390253 -465074 -867358 -794390 -915224 -403691 -377981 -33147 -498786 -315705 -454663 -990938 -537730 -595477 -656355 -78997 …
Output: 133443410047454

Constraints:

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

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