CT22045

Rowena and the Jade ingots

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Rowena found an old ledger of ingots in the archive attic at the seal rocks of Barking Cove. The margin notes pose a precise question. Task: Read n integers and print their total sum. Input format: First line: n. Second line: n space-separated integers. Output format: Print the sum of all n values. Constraints: 1 <= n <= 796; -1000000 <= a[i] <= 10; answers fit a signed 64-bit integer.

Example 1:

Input: 69 -885047 -178243 -616740 -571940 -169166 -131169 -176711 -268173 -606413 -646822 -920130 -719871 -846342 -119757 -12842 -344694 -118016 -807244 -844077 -196529 -517871 -864481 -927684 -909867 -784413 -562111 -298994 -567501 -173699 -227727 -99952 -786070 -632068 -894626 -943580 -793338 -985133 -196520 -86940 -72588 -905274 -620012 -849169 -739632 -34455 -212357 -287890 -63497 -454863 -489789 -647515 -606711 -187211 -614656 -709689 -939458 -47481 -939632 -124078 -102363 -514300 -792275 -149352 -274860 -652633 -626906 -695205 -207626 -304396
Output: -34298374

Example 2:

Input: 352 -465783 -923357 -562058 -444776 -898467 -446193 -258682 -317821 -457016 -208487 -952438 -328895 -286007 -802061 -757364 -312004 -166165 -116270 -543471 -45208 -761575 -610348 -112566 -770164 -231799 -48557 -411678 -847878 -508352 -197107 -641319 -759994 -277506 -578020 -216252 -900725 -298203 -807855 -553796 -813542 -714617 -851372 -444179 -287464 -851033 -782391 -880955 -305288 -955459 -504506 -62314 -522284 -555866 -620658 -996379 -3377 -821759 -251987 -416663 -983147 -692918 -113190 -839044 -842298 -875242 -370595 -82559 -877146 -104044 -693778 -196616 -247874 -577646 -836094 -914399 -720637 -177933 -235157 -674279 -291685 -197961 -187356 -531117 -668395 -988213 -909528 -528014 -299842 -778724 -714038 -149458 -930062 -775073 -366558 -968687 -830073 -50285 -208941 -208738 -519532 -10…
Output: -175200489

Example 3:

Input: 705 -636998 -301140 -561267 -892016 -825127 -363434 -246325 -76172 -71321 -77141 -265942 -321045 -14318 -571987 -789131 -63766 -114957 -899208 -189507 -620958 -348307 -651914 -99052 -897256 -419023 -641237 -914192 -192165 -29925 -735445 -663307 -889453 -312638 -888499 -202468 -51598 -432330 -577429 -800384 -778684 -46949 -554086 -292166 -913219 -556176 -425547 -429499 -374683 -781176 -911441 -32495 -443764 -584656 -698364 -638513 -86839 -2122 -706841 -893538 -860403 -450668 -618410 -468034 -923594 -529594 -544279 -630346 -474214 -208739 -217060 -816541 -690962 -670321 -46424 -571149 -440171 -161855 -170570 -681167 -974189 -842657 -452290 -70962 -39678 -871097 -834612 -171710 -556592 -183624 -897155 -238944 -900232 -201120 -762259 -383049 -226112 -205235 -191059 -13554 -275222 -758123 -5877…
Output: -350264856

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Rowena and the Jade ingots - EASY Coding Problem | CodeTikki