CT27471

Baron's stamps Reckoning

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

At the windmill fields of Gusthaven, Baron records each stamps in a worn leather ledger. The guild wants answers, not guesses. 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 <= 298; -1000000 <= a[i] <= 1000000; answers fit a signed 64-bit integer.

Example 1:

Input: 95 30734 522647 179429 -267955 912809 233193 404314 -355815 -114164 -175390 668178 -544847 -402881 577547 422134 393664 507554 163442 670761 560338 -534420 -581567 -859282 -964200 -13941 583342 -3091 -367846 175220 830440 820696 -906574 -766949 499887 -8182 744814 274772 -923380 665972 -684317 -688103 -865872 942977 56350 -810052 -886342 -963200 353335 174332 -935863 -704509 -503247 183864 -182515 -207279 -439748 794775 147122 -119162 303296 -321887 867369 -754301 417831 861837 485380 72269 173914 -291117 460414 -876670 -496309 -944673 439147 -914063 672518 681124 -431797 -863628 216893 -866762 205762 126098 -421455 121510 402290 972973 -293046 62280 -204854 -861060 -259559 237392 -883719 791540
Output: -3399114

Example 2:

Input: 281 -983275 -709958 542497 -203562 529765 232901 339030 -884871 217763 619486 321857 -536213 -360450 -666013 -398113 32848 314640 -833890 -695354 613887 -584783 -348337 411489 -291935 587767 255320 -602769 861752 -804351 -835130 -133059 675553 -18148 -681379 190769 829983 959924 -668066 -54220 575215 784442 -14852 176678 -509000 540657 525073 442139 599825 363373 -517874 -527558 643120 495783 -129667 885742 202197 -232024 366944 -992963 108464 80365 -375169 -888186 95091 -289520 -454139 -991850 810389 813502 -756260 -108574 -46400 -363633 -559583 42471 824669 83612 -583079 -84704 597649 857486 940118 328938 106973 -849684 943066 164844 942233 -390884 -543482 366561 973648 259253 -75853 -65772 -702161 742863 -275754 63294 -87155 -800574 -759988 570835 -77475 -306736 665754 -899746 -186874 -…
Output: 5966787

Example 3:

Input: 60 -72913 -154099 -968988 962278 320799 671622 938659 718661 -707305 196052 380121 -200828 932734 -784987 944610 730424 858234 -380897 -386363 -772490 2461 838609 -172862 -162364 685937 -494371 -795373 -101982 714465 -251380 758416 -839617 -619715 -633980 396839 325643 94849 -245500 471503 535788 -905177 774471 -719111 645312 -654084 991255 -992458 -588469 -136715 23477 -46324 -887615 -974224 -396130 49401 447011 337425 768458 863235 -250681
Output: 2081747

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.