CT26185

Ivo Counts the coins

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Ivo found an old ledger of coins in the apothecary attic at the anvil district of Hammerfall. 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 <= 545; -1000000 <= a[i] <= 1000; answers fit a signed 64-bit integer.

Example 1:

Input: 175 -807190 -649226 -467808 -909842 -180651 -703295 -938076 -512659 -679477 -201268 -276158 -716271 -237976 -371348 -602288 -262880 -789048 -125782 -504570 -562309 -260465 -263992 -653522 -245876 -605142 -468434 -181297 -903295 -986791 -430447 -685235 -208700 -125686 -302370 -265505 -609100 -137253 -188369 -258952 -433785 -353129 -447904 -17251 -249994 -720099 -788252 -289592 -101131 -411637 -969103 -694120 -525013 -82473 -428332 -46475 -901721 -480496 -306012 -876064 -470292 -580251 -401478 -664248 -502948 -636193 -669707 -661914 -384142 -129109 -380308 -682853 -454211 -851272 -13166 -766793 -451223 -244188 -238180 -643973 -499431 -592677 -255988 -392813 -414567 -257196 -501541 -432763 -323184 -342463 -471970 -34986 -528294 -309299 -501328 -28194 -857311 -820155 -151645 -903398 -445321 -106641 -52583 -131985 -781695 -433557 -628165 -67931 -748845 -658557 -317467 -405956 -52694 -812818 -471201 -530506 -281106 -754678 -775463 -426371 -35906 -411239 -909215 -632059 -361605 -924380 -39342 -151185 -860220 -824304 -968831 -62900 -514118 -353101 -282785 -967204 -144602 -654057 -8214 -89186 -408667 -389797 -692166 -28417 -740067 -170303 -32497 -322652 -908608 -680885 -756804 -173689 -636350 -277483 -236337 -584553 -856704 -501423 -67119 -469758 -867355 -43822 -986794 -687834 -264415 -561793 -184834 -343480 -795829 -591251 -349913 -476616 -988071 -21615 -577650 -314529
Output: -80914861

Example 2:

Input: 391 -55932 -965853 -278850 -234642 -511083 -129046 -808563 -552561 -769949 -746866 -78123 -885593 -591495 -734372 -511043 -978637 -651884 -455905 -234754 -219335 -336767 -897977 -114137 -864041 -478820 -547991 -524485 -86687 -435010 -844048 -117331 -924663 -570126 -137964 -426084 -468682 -295936 -682731 -377839 -587662 -380347 -145133 -893463 -373677 -567298 -810337 -219114 -978559 -504693 -594968 -255712 -800329 -765390 -621667 -351020 -175505 -539454 -92680 -437323 -159402 -130643 -3998 -346632 -832270 -256226 -818471 -502146 -14322 -952116 -251311 -839779 -251074 -374845 -426596 -191731 -796486 -20007 -638174 -908963 -283053 -570332 -469406 -745517 -154443 -339445 -119553 -497392 -237466 -520210 -541146 -524217 -270318 -665517 -123907 -525027 -21197 -443290 -247980 -31931 -332006 -840135 -434694 -290765 -399758 -37150 -776872 -898594 -974848 -5069 -388320 -540783 -818240 -173600 -813804 -19317 -236149 -216336 -485969 -857800 -999611 -491022 -651376 -662677 -818938 -575876 -948632 -290843 -448714 -646760 -655632 -829215 -855548 -598047 -646269 -120500 -264667 -636807 -652789 -355402 -242804 -92445 -428498 -652873 -479897 -552210 -382790 -839728 -116387 -460067 -660624 -503739 -92092 -636140 -248289 -518468 -515723 -10784 -884887 -67562 -539791 -844937 -586799 -560731 -413368 -680503 -413720 -15380 -177021 -337404 -466813 -964434 -919528 -183352 -451597 -668013 -551444 -617557 -647997 -766473 -790504 -502397 -765304 -940926 -917997 -631468 -579131 -97022 -60722 -311721 -13642 -864329 -254857 -206008 -86526 -154564 -395104 -34626 -695920 -38020 -816415 -595446 -510876 -462076 -321362 -457990 -168043 -274322 -959047 -437602 -449065 -298972 -725144 -983824 -704461 -301324 -11554 -97355 -351539 -401258 -612371 -355391 -155392 -159643 -647480 -648974 -928695 -644824 -579164 -462022 -593758 -665033 -809654 -580626 -793577 -958323 -142012 -170342 -292664 -529502 -913165 -962583 -272579 -614117 -426724 -340617 -121857 -876405 -593532 -702679 -997783 -747189 -981288 -647842 -876762 -738644 -677785 -521962 -913007 -449985 -432701 -881043 -298301 -838243 -728621 -460270 -636133 -125053 -700041 -8004 -378172 -151184 -511259 -746949 -667735 -649916 -790116 -983969 -133590 -502536 -842831 -937048 -394477 -166955 -655817 -434146 -742234 -506070 -312779 -45447 -23944 -836307 -820230 -746102 -83286 -964507 -549512 -682978 -584676 -853696 -60323 -35180 -937756 -86281 -757351 -34383 -840133 -972590 -128029 -914020 -971276 -389927 -26798 -351493 -89829 -943944 -755566 -821845 -882809 -97170 -506157 -507078 -499137 -995908 -978425 -841525 -663852 -899741 -949777 -946776 -885128 -433610 -557183 -499909 -358438 -103731 -84632 -920702 -293662 -17856 -307088 -222611 -953578 -877526 -367764 -487223 -576901 -558452 -289131 -316471 -640462 -984595 -143437 -676928 -159456 -854688 -196129 -278294 -203458 -381152 -4051 -745911 -495267 -770209 -852784 -213199 -794067 -376760 -606222 -538854 -626221 -838454 -351560 -888136 -41548 -780785 -345507 -304532 -199538 -291306 -747501 -619112 -269889 -756394 -713079 -672499 -475587 -212311 -695657 -550673 -812814 -148838
Output: -198384910

Example 3:

Input: 136 -662695 -931262 -773283 -43122 -422422 -183035 -981266 -939807 -876348 -563318 -975973 -113102 -258818 -619587 -983948 -633258 -80257 -481840 -853979 -668351 -833833 -94278 -438495 -429036 -132040 -701260 -376961 -807856 -297575 -456130 -263374 -999233 -69128 -743921 -550703 -738214 -334691 -59364 -121302 -982351 -102438 -318810 -75515 -944512 -581467 -356249 -516074 -724186 -142091 -249366 -472797 -187075 -708769 -331708 -900090 -94768 -747303 -758917 -807063 -125996 -125179 -480233 -714288 -724696 -189181 -763791 -851449 -163719 -487622 -195108 -565668 -850752 -418591 -43666 -861419 -401774 -58955 -383875 -965314 -969037 -341664 -274621 -62162 -629895 -856241 -576810 -272717 -18939 -330387 -533375 -353178 -388801 -705755 -23684 -787783 -221698 -412226 -481395 -354412 -530256 -891252 -271392 -385110 -668421 -47500 -491032 -421041 -683174 -326408 -189171 -740779 -527785 -142709 -807867 -705609 -310951 -764988 -876810 -778771 -391060 -329983 -777516 -152391 -130504 -954618 -522971 -732383 -363873 -226307 -853599 -850469 -315317 -361657 -133496 -194785 -166321
Output: -66478946

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Ivo Counts the coins - EASY Coding Problem | CodeTikki