CT22609

The Hammerfall Square Sum

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Freya found an old ledger of crates in the workshop attic at the anvil district of Hammerfall. The margin notes pose a precise question. 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 <= 871; 0 <= a[i] <= 1000000000; answers fit a signed 64-bit integer.

Example 1:

Input: 683 3323 6475 1209 4774 6790 3736 6198 7957 5664 2655 9665 1600 6975 7830 1036 4569 3242 4369 4768 6110 1284 3944 8577 6136 275 8969 4535 5356 7774 2691 3025 1531 2299 1179 4362 7961 8776 5920 7447 6270 2969 4559 8353 7144 6044 5454 2118 7124 4852 9951 4212 8435 3010 5076 1052 6697 9515 8851 247 2346 7452 8773 6185 5756 6838 7339 1375 7910 2163 760 3433 7382 8694 2853 653 113 2622 6725 1542 7378 6329 4978 6814 2696 1773 5973 7328 7643 4384 6384 5444 9758 4323 2927 6730 8878 1025 4190 9897 2416 6499 9939 189 5408 5978 836 6845 3483 4637 1550 8291 4528 7091 4360 2148 5292 7475 3263 559 855 7829 5553 6780 9031 2249 141 9999 9686 4475 392 8276 7316 349 7697 1058 777 7148 1317 39 4639 4456 3970 1434 5771 2310 1509 9399 3040 9678 9433 7423 5158 7636 7060 8836 1726 2507 2605 8895 7021 6071 7545 3…
Output: 24297210299

Example 2:

Input: 758 9134 7677 6284 4406 9141 3794 3187 8170 1381 8402 6824 4991 2648 5949 2293 9113 7124 6217 3274 2450 7791 2181 7217 5510 2385 4601 7687 4107 8711 1644 245 3966 5990 5635 7687 5461 8378 837 5721 8868 1126 2327 3947 678 8062 3287 2435 5012 5375 3176 4804 9387 5786 3811 6859 6187 3914 1885 6174 5992 3519 9189 781 2274 4256 8140 18 8889 8742 564 6642 502 8580 5988 3540 521 1142 8263 6268 1906 7528 6586 2833 789 4529 5943 2431 6243 6895 1674 2697 8174 9338 843 6371 9186 6359 3117 4581 3440 1037 1377 7922 9156 5255 6735 5227 9216 1798 5887 2167 8246 302 9350 1243 1720 9192 7985 5346 7808 990 5400 7873 3014 9292 2054 8109 6362 2550 8681 8127 6910 5966 1266 6723 5037 5377 3676 6548 172 4225 7899 4672 5896 3536 7927 4434 1339 2968 5851 6180 7353 1778 4218 1075 9258 53 3924 6448 910 5336 1307 781…
Output: 24709109149

Example 3:

Input: 242 3911 4780 5822 3463 2489 2022 7353 6775 8683 7095 7546 7861 2153 8852 8425 1832 7937 8130 2836 1800 7027 2736 7502 9729 8640 7240 6206 9411 7064 5312 1720 9231 3189 4206 4628 8329 547 1851 2586 4773 7786 2681 8493 9817 6234 4663 4640 8533 9709 2905 8038 4580 6607 2191 9964 152 7049 2784 3811 6401 6436 5669 2295 1896 1065 7087 188 2239 5682 5034 758 1368 8331 8296 9828 9710 8927 4923 6626 9278 7457 9622 1111 2514 8510 8442 5968 7997 8751 6598 694 4431 1061 9664 5622 6582 2612 9029 8398 4869 7970 6542 1521 6441 196 4904 5890 9868 2443 424 5759 2950 8520 5343 6725 6788 4561 9812 1185 4890 8582 736 648 9184 4245 61 2185 1040 3375 8441 2094 210 775 9849 7546 3102 259 3708 1696 7487 2132 7627 5158 3500 3475 1026 7032 5148 683 7484 9712 6536 9399 8503 6407 2385 4125 5420 1346 2152 3958 4972 2…
Output: 8529353527

Constraints:

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

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