CT22048

Emir and the Timeworn scrolls

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Caravans arrive at the bamboo terraces of Verdantstep with crates of scrolls, and Emir the chronicler must account for every last one. 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 <= 645; -100 <= a[i] <= 1000000000; answers fit a signed 64-bit integer.

Example 1:

Input: 6 1465 3412 1883 9627 8625 4473
Output: 204411141

Example 2:

Input: 303 3235 2336 1110 810 5007 3167 7546 8147 2763 6062 2124 4535 7744 4550 8423 9942 9358 2972 4900 2787 8304 7642 5024 5165 7669 8768 8407 9085 7476 3910 2555 2377 5028 6998 8479 8540 73 4089 412 3317 2203 8004 13 8826 349 8254 4558 8298 7778 6580 2391 3410 7736 72 6204 9012 130 4835 4814 1499 1276 2253 6650 170 7044 2607 6947 361 8681 8917 7128 9689 2082 4120 5771 9150 4576 5012 7684 4006 6892 1779 1057 6191 7233 9445 585 2778 7292 9045 2915 4980 1430 3183 1219 2588 2954 4292 5715 1885 3673 3356 8495 1327 7346 7213 7619 5496 3538 6917 7950 286 293 4629 2167 1805 6263 2427 4749 1399 3692 2904 6870 5424 4898 4723 9780 8884 1270 3873 9864 1892 8570 2362 3632 5513 799 8509 7863 6415 1733 157 3630 3348 9098 8958 5889 967 9163 2097 814 3757 8475 8428 4359 6024 4115 870 3703 416 980 4129 2486 270…
Output: 10240478503

Example 3:

Input: 277 9883 7384 4666 1696 8069 6830 41 9070 9943 9498 599 2476 6100 4217 274 5149 -29 7588 136 8758 1784 7985 8003 1940 4370 9512 4410 368 5429 -56 8267 3462 7853 4357 3641 1245 9167 7176 501 6846 6116 3009 1843 3780 7475 1458 3352 1713 1678 7340 2330 7672 5068 5986 8815 5194 5934 4045 7825 2517 3501 7496 7676 4676 4356 4423 3269 9050 2237 2516 4426 1282 8046 8838 2141 9763 4142 7698 7899 5893 7596 7916 3477 8341 7767 9801 3068 7363 9058 2369 3889 3220 6213 9933 1812 2486 298 894 1973 6416 8280 742 6553 7791 7344 5445 7085 5475 1268 6802 5359 7435 6969 8349 2556 8751 6166 7073 6790 8055 1946 6178 9024 7131 -35 6958 7676 3419 2258 5487 3928 9544 7805 7116 8459 2689 3069 1305 4212 6980 7019 5651 7537 952 6787 1163 7896 1660 8697 8515 6099 5044 4492 1225 5818 3395 9157 1556 2892 5065 8026 1892 …
Output: 10108033863

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Emir and the Timeworn scrolls - EASY Coding Problem | CodeTikki