CT23206

The Rye Hollow Square Sum

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Morning light hits the gristmill of Rye Hollow as Lamplighter unrolls the day's manifest of lanterns. 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 <= 488; -100 <= a[i] <= 1000; answers fit a signed 64-bit integer.

Example 1:

Input: 67 810 240 479 793 372 282 799 418 982 -77 787 27 120 158 721 53 839 476 209 -22 119 555 -56 523 137 923 2 543 285 778 413 157 700 354 351 115 227 828 438 0 843 803 -15 965 76 588 314 162 965 260 -16 691 426 67 308 84 -27 255 355 669 667 -6 934 293 603 -93 993
Output: 17985370

Example 2:

Input: 172 421 403 368 68 446 50 388 86 -19 266 255 -65 -13 -47 853 17 980 223 422 784 484 793 125 472 714 374 173 -86 727 993 979 397 647 149 110 302 427 848 893 218 20 912 472 871 182 565 474 266 400 961 300 582 920 483 -29 66 647 286 937 585 173 144 718 178 351 -68 181 776 -10 431 240 -26 541 47 285 782 563 375 273 856 763 693 593 357 817 344 615 564 835 927 776 325 70 215 729 978 876 764 239 93 473 321 710 702 286 75 525 891 112 514 842 659 116 181 326 738 419 409 440 138 798 261 667 40 103 550 765 998 18 189 489 103 534 710 921 726 -100 383 120 327 597 408 126 382 73 540 472 85 799 916 662 568 849 -35 32 235 319 370 783 304 714 416 633 20 86 818 546 -28 829 -47 889 482
Output: 48973644

Example 3:

Input: 226 140 868 706 559 929 856 832 234 635 311 734 57 469 464 70 744 767 315 22 73 306 103 668 -75 330 817 967 -21 729 347 711 312 847 319 318 294 813 257 12 394 894 461 924 164 806 991 54 998 445 330 959 535 882 758 721 275 471 803 635 226 438 576 -92 46 -14 142 -69 834 951 574 75 506 598 358 359 625 552 472 915 975 722 653 114 848 297 553 980 691 413 893 957 789 340 558 610 389 406 566 2 277 917 -76 220 874 463 307 98 310 168 527 820 457 897 256 426 606 657 356 287 -34 925 184 230 -62 848 192 352 395 818 -28 663 197 526 546 935 735 570 20 554 375 161 762 975 -27 703 -41 237 -88 204 154 822 835 218 867 843 765 957 737 934 898 29 980 959 350 54 950 789 620 -79 602 921 224 79 160 411 881 10 687 123 578 241 924 917 233 965 12 894 269 364 968 438 721 168 -100 88 796 572 37 182 616 10 418 728 907…
Output: 76642376

Constraints:

1 <= n <= 488; -100 <= a[i] <= 1000; answers fit a signed 64-bit integer.

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