CT27755

Jace Counts the lanterns

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

It is audit day at the bamboo terraces of Verdantstep. Jace spreads the lanterns records across the table and picks up a sharp pencil. 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 <= 272; -1000000 <= a[i] <= 10; answers fit a signed 64-bit integer.

Example 1:

Input: 22 -732726 -251844 -242776 -716096 -75333 -620848 -593541 -918087 -311198 -599170 -620570 -246015 -665453 -400811 -970454 -463315 -486067 -282867 -329951 -803814 -348313 -351474
Output: -11030723

Example 2:

Input: 129 -809332 -201226 -164755 -318847 -710347 -921805 -842543 -419022 -610181 -347941 -821475 -758867 -943330 -961633 -128352 -566778 -926376 -338503 -813976 -842816 -479398 -615919 -839799 -142282 -777136 -969123 -781390 -635863 -946342 -217439 -951419 -450907 -936124 -361842 -137813 -715077 -920157 -151405 -103401 -745267 -180314 -178982 -499220 -386960 -544832 -178959 -810389 -621899 -163017 -968297 -818521 -716425 -737702 -87143 -724190 -777375 -464762 -283187 -775292 -675970 -671958 -239616 -163424 -192357 -253203 -912194 -979177 -829338 -247623 -593456 -114981 -715198 -854845 -20370 -56476 -714158 -767312 -138781 -503456 -780542 -338328 -965868 -896645 -420060 -827030 -911099 -465878 -439145 -450878 -64574 -286904 -468611 -429867 -721944 -235919 -305790 -722525 -26180 -167788 -297431 -128910 -759154 -630767 -995897 -438285 -342307 -940330 -469936 -423385 -375138 -835821 -670096 -35245 -993858 -413281 -571222 -677131 -913233 -255382 -291318 -34667 -358842 -573347 -208182 -289687 -485378 -887635 -149700 -983656
Output: -69242363

Example 3:

Input: 102 -395286 -921395 -601034 -458109 -263648 -188627 -938504 -524668 -727352 -6976 -351638 -472295 -512305 -122222 -408708 -429061 -837934 -776076 -239945 -934734 -549414 -972722 -239877 -732424 -180190 -242584 -135216 -411488 -229761 -645111 -866925 -756967 -883469 -672615 -593424 -780688 -849539 -419431 -913588 -461834 -313752 -209853 -118022 -416447 -238474 -127499 -689013 -540958 -856308 -710881 -978293 -477745 -117467 -299646 -719258 -666697 -589517 -860499 -363491 -904518 -239334 -447581 -201121 -441102 -86165 -335771 -881363 -944912 -867301 -852649 -795171 -515452 -344856 -972010 -161963 -139020 -992126 -573677 -539855 -156693 -833093 -876486 -11445 -822940 -838628 -662348 -415041 -205021 -855576 -143252 -963184 -452346 -961613 -550903 -597299 -636765 -257147 -429335 -807573 -731358 -172663 -766614
Output: -55324874

Constraints:

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

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