oj mrJudge
Toggle navigation
  • Login
    • Forget Password
      Login
User Image

Hello, Stranger

Guest
  • Analysis Mode
  • Problems
    • All Problems
    • Latest Problems
  • Join Us Now
  • Registration
  • Contact Us
  • Infomation
  • About
    • Terms of Use
    • Technical Specifications
    • Credits

executions Batch , stdin/stdout

Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

executions.html

Problem Description

By the laws of Bearlands, freedom of speech is limited, and no citizen is allowed to send any email to anyone else in Bearlands. However, due to loose control of the internet, Desmond, the dictator of Bearlands, has somehow found out that there has been a massive flood of emails going around Bearlands and he intends to stop it!

Bearlands is made up of a city is made up of N houses. The new law of Bearlands now states that for every email a household sends out, one person in the household must be executed. In other words, if a household sends out E emails, there will be E executions from that house. You will be given the number of emails sent by each household. Calculate the number of executions that will be held in Bearlands due to this offense.

Input

The first line of input will contain one integer, N.
The second line of input will contain N integers, where the ith integer will indicate the number of emails sent by the ith house.

Output

Your output should contain one line with one integer, the total number of executions to be held.
Your output should end with a newline.

Limits

1 <= N <= 100 000

Sample Input 1

5
1 2 3 4 5

Sample Output 1

15

Sample Input 2

7
2 3 1 4 5 10 9

Sample Output 2

34

Tags

Syntax

Subtasks and Limits

Subtask Score #TC Time Memory Scoring
1100101s64MBMinimum
2021s64MBMinimum

Judge Compile Command

g++-8 ans.cpp -o executions -Wall -Wshadow -static -O2 -lm -m64 -s -w -std=gnu++17 -fmax-errors=512

Accepted Submissions

subIDUserTimeMax Time

Past Submissions

subIDUserTimeScore
mrJudge 09.05.20
Copyright © 2020 mrJudge. All rights reserved.