CT25104

The Pale Square Sum

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

The council of the glass towers of Prismhaven pays by the answer, and Dev intends to earn it. First: the full register of tickets. 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 <= 623; 0 <= a[i] <= 1000000; answers fit a signed 64-bit integer.

Example 1:

Input: 54 2944 7142 4893 5660 6641 1472 5343 4570 4007 5633 8832 6912 3738 5273 4386 1470 2699 6529 537 4142 5448 2267 9703 5578 6893 8997 1552 7205 7401 2715 4674 6057 8071 1390 2548 8319 7771 9135 2331 6470 1467 731 7828 4870 2039 572 3680 7342 3304 4002 942 3377 2014 4661
Output: 1537515703

Example 2:

Input: 418 8983 7035 3066 8826 2676 7491 6889 8038 7572 4144 4274 7415 2962 4276 8776 5397 3371 4579 3171 2008 1713 9251 2909 3631 3728 4163 8334 8321 230 1145 8020 819 9948 3520 6745 943 4194 1936 4911 4997 2102 7145 5708 3909 3692 4528 7399 5896 5928 6183 756 5882 4177 2309 6354 6205 7804 6095 4382 9328 4052 9348 30 9146 7850 7714 355 4480 4533 5218 5641 590 8547 2307 5591 1233 6980 1384 5018 5824 1965 6779 7906 4788 2592 822 9253 2076 9862 1109 5915 6909 746 8613 6178 477 5250 3568 9036 267 4135 4621 5643 1537 9644 5791 3777 5904 7410 4022 1020 3647 8027 9080 6952 7650 5376 2340 7044 4586 8954 620 4026 4971 350 1653 9818 928 3697 1000 6531 2272 9940 1850 2794 1148 7739 8250 5199 1699 9998 2717 3361 5378 269 1150 6990 5682 3563 8643 7923 7283 5597 1780 238 3638 6325 4135 9611 1752 8111 9228 680…
Output: 13423775476

Example 3:

Input: 18 5821 8565 3959 4879 9396 2417 8981 6645 231 4123 369 3634 8451 59 3322 4550 3000 9361
Output: 595846673

Constraints:

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

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