CT27503

Chandler's scrolls Reckoning

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Legend says the vault under the rookery of Crowhaven opens only for a perfect tally of scrolls. Chandler means to find out. 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 <= 731; -100 <= a[i] <= 1000000000; answers fit a signed 64-bit integer.

Example 1:

Input: 165 3023 -7 3587 3856 6106 4451 6313 1757 1589 2386 3134 3062 5444 6877 8805 156 1601 8769 9150 4456 904 6588 751 3983 9109 5443 2663 1605 6174 5289 8435 6681 5884 6911 8586 1909 1690 6105 9745 184 -73 4064 1279 43 8247 1515 2554 1372 7140 2201 9193 1764 9753 474 1686 5695 3557 1669 3593 9032 9082 9633 8986 6560 9554 5664 3372 1877 6236 1761 2649 5944 6132 6384 7445 1061 3773 5558 9065 4261 9633 3100 2132 1059 8801 6937 2776 6169 325 6327 7455 1440 4588 -26 422 7676 7910 3692 4188 6513 1627 2746 5685 2061 4416 1687 5944 5385 5470 9359 3695 2618 8296 1440 8761 7577 2583 2418 5356 4949 3399 8247 2812 1671 7837 7199 1211 1584 6928 5973 7192 8946 8997 8198 1122 4684 5079 9237 3975 7826 9226 6544 9779 922 5443 8540 4762 9836 7397 7109 4094 6775 7985 8330 1879 7374 6961 6815 1207 5069 9962 3394 …
Output: 5586306356

Example 2:

Input: 123 4891 8909 9900 2762 514 9218 4551 4784 4611 9149 9082 4775 6998 8035 3943 4052 1247 4240 8341 2557 3685 9922 7945 629 3236 255 4960 594 2787 3551 6646 2977 -4 435 5878 3669 3533 3962 1182 6904 2203 8517 6347 7788 -6 2743 4949 1529 1633 1896 554 9683 6117 4836 2433 9923 4275 5869 4880 4567 9038 8774 9147 5764 9138 4636 622 2943 8491 3483 7605 8080 293 3941 2669 8852 5923 2788 8323 883 3539 5375 4329 3760 8104 2086 682 1881 8955 2483 93 6028 2858 6595 -10 2424 1732 274 5186 3877 2664 6894 6510 6504 6241 8411 197 4142 6621 4493 4902 1746 7441 9618 6643 2037 8741 447 1947 6917 8422 739 3778
Output: 3726605680

Example 3:

Input: 40 9970 9832 9760 9846 3420 8950 5283 5696 4392 6337 5221 8034 903 471 8971 6261 3010 4886 415 4208 525 4451 6507 6534 2703 729 6287 6094 3886 1215 7640 8681 5029 8922 9557 7092 1362 2216 6401 8749
Output: 1573941680

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Chandler's scrolls Reckoning - EASY Coding Problem | CodeTikki