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

meanstring Batch , stdin/stdout

Registered Users Only

Please login to utilize this feature.

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

meanstring.html

Rar the Cat wants to play with a piece of string, but his string is special. As with the tradition of the Nation of Insanity (NOI), all strings are made of numbers! (We did say insanity)

Not knowing the average of the string of numbers you're playing with isn't fun. But Rar's intense focus on murdering the string has made him unable to do any calculations.

Help Rar find the average of all the numbers! (There may be decimals, just ignore them. int will do that for you automatically)

Input

The first line of input containes an integer, N, that denotes the length of the string of numbers.
This is followed by N integers, the ith integer being the ith number on Rar's string.

Output

A single number, the average of the number on the string

Limits

0 ≤ N ≤ 1000

The sum of all numbers will fit into a 32-bit signed integer.

Sample Input 1

5
1 2 3 4 5

Sample Output 1

3

Sample Input 2

20
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Sample Output 2

10

Tags

Syntax

Subtasks and Limits

Subtask Score #TC Time Memory Scoring
110081s32MBAverage
2021s32MBAverage

Judge Compile Command

g++-8 ans.cpp -o meanstring -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.